<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>PHP 4u Web developer - 代码的简化 &#187; 500 internal error</title>
	<atom:link href="http://php4u.co.uk/tag/500-internal-error/feed/" rel="self" type="application/rss+xml" />
	<link>http://php4u.co.uk</link>
	<description>PHP related blog, freelancer to hire!</description>
	<lastBuildDate>Fri, 27 Aug 2010 12:09:42 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Symfony admin generator problem</title>
		<link>http://php4u.co.uk/2009/03/symfony-admin-generator-problem/</link>
		<comments>http://php4u.co.uk/2009/03/symfony-admin-generator-problem/#comments</comments>
		<pubDate>Mon, 23 Mar 2009 15:29:03 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Symfony]]></category>
		<category><![CDATA[500 internal error]]></category>
		<category><![CDATA[cache]]></category>

		<guid isPermaLink="false">http://php4u.co.uk/?p=69</guid>
		<description><![CDATA[When you change your schema.yml file, especially removing column which you used before for sorting you can have face problem with 500 internal server error. Why? If you look closer into cache directory with auto-generated files you can see: ?View Code PHPprotected function addSortCriteria&#40;$c&#41; &#123; if &#40;$sort_column = $this-&#38;gt;getUser&#40;&#41;-&#38;gt;getAttribute&#40;'sort', null, 'sf_admin/tag_elements/sort'&#41;&#41; &#123; $sort_column = TagElementsPeer::translateFieldName&#40;$sort_column, [...]]]></description>
			<content:encoded><![CDATA[<p>When you change your <strong>schema.yml</strong> file, especially removing column which you used before for sorting you can have face problem with 500 internal server error. Why?</p>
<p>If you look closer into cache directory with auto-generated files<br />
you can see:</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p69code2'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p692"><td class="code" id="p69code2"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> addSortCriteria<span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$sort_column</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getUser<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&amp;</span>gt<span style="color: #339933;">;</span>getAttribute<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'sort'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">null</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'sf_admin/tag_elements/sort'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #000088;">$sort_column</span> <span style="color: #339933;">=</span> TagElementsPeer<span style="color: #339933;">::</span><span style="color: #004000;">translateFieldName</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$sort_column</span><span style="color: #339933;">,</span> BasePeer<span style="color: #339933;">::</span><span style="color: #004000;">TYPE_FIELDNAME</span><span style="color: #339933;">,</span> BasePeer<span style="color: #339933;">::</span><span style="color: #004000;">TYPE_COLNAME</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>So the sort element comes from <strong>SESSION</strong>! Even when you clear cache (<em>symfony cc</em>), session stays same.</p>
<p>Whenever you do changes, clear browser cache!</p>
<p>Affects Symfony 1.0.17</p>
]]></content:encoded>
			<wfw:commentRss>http://php4u.co.uk/2009/03/symfony-admin-generator-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.622 seconds -->
