{"id":23,"date":"2009-03-12T09:34:38","date_gmt":"2009-03-12T07:34:38","guid":{"rendered":"http:\/\/blogs.igalia.com\/jaragunde\/2009\/03\/12\/adventures-upgrading-ez-publish-to-401\/"},"modified":"2009-03-12T09:34:38","modified_gmt":"2009-03-12T07:34:38","slug":"adventures-upgrading-ez-publish-to-401","status":"publish","type":"post","link":"https:\/\/blogs.igalia.com\/jaragunde\/2009\/03\/adventures-upgrading-ez-publish-to-401\/","title":{"rendered":"Adventures upgrading eZ Publish to 4.0.1"},"content":{"rendered":"<p>Some weeks ago we upgraded our CMS, eZ Publish, to the latest version in that moment, 4.0.1, with the intention of leaving behind PHP4 and switching to PHP5, the only one supported by the 4.x series. And although there is nice documentation about the process in <a title=\"eZ Publish documentation\" href=\"http:\/\/ez.no\/doc\" target=\"_blank\">ez.no<\/a>, you&#8217;ll probably find some little problems which aren&#8217;t documented there.<\/p>\n<p>With the aim of helping those who could have similar problems to mine, I&#8217;ll list and explain them a bit. \ud83d\ude42<\/p>\n<p><strong>Switching to UTF-8<\/strong><\/p>\n<p>There&#8217;s a script to convert all the data in the DB to UTF-8, but when I tried it I found some problems; most of the data were corrupted after running it. In that moment, I found a related entry in eZ Publish bug tracker (<a href=\"http:\/\/issues.ez.no\/IssueView.php?Id=13674\" target=\"_top\">#13674<\/a>) where there was a patch which worked for me, but it very likely you won&#8217;t have this problem any more; the bug is closed and it says the patch has already been merged to stable (in fact, now the latest version is 4.0.3. These guys work really hard! \ud83d\ude09 ).<\/p>\n<p><strong>Moving templates to the correct place<\/strong><\/p>\n<p>Once the server was upgraded and running again, we noticed some template files weren&#8217;t rendered. I discovered that you have to place new template files in the directory <em>design\/plain\/templates<\/em> by imperative in eZ 4, but in previous versions you could place them in <em>design\/plain\/override\/templates<\/em> although there wasn&#8217;t any override. I had a lot of auxiliary files stored in <em>override<\/em> which were original files, not overrides, so I had to move them.<\/p>\n<p>For example, I have a template file <em>show_comments.tpl<\/em> which I include from <em>news.tpl<\/em> and <em>article.tpl<\/em>. I had it stored in <em>design\/plain\/override\/templates<\/em> with the latter two files. But <em>show_comments.tpl<\/em> is, obviously, an original file, not overridden (there isn&#8217;t any entry in <em>settings\/override.php<\/em> for it), so I had to move it to <em>design\/plain\/templates<\/em>, while <em>news.tpl<\/em> and <em>article.tpl<\/em> stay in the <em>override<\/em> directory.<\/p>\n<p>So, if you made the same mistake as me when writing template files, now it&#8217;s the time to amend it \ud83d\ude42 .<\/p>\n<p><strong>eZ Archive cronjob script not working anymore<\/strong><\/p>\n<p>We have the <a href=\"http:\/\/ez.no\/developer\/contribs\/cronjobs\/archive\" target=\"_blank\">archive cronjob script<\/a> installed in our server, with some customization, to move old content to an archive. After the upgrade it broke due to differences between eZ 3.x and eZ 4.x APIs. This was the error message:<\/p>\n<p><code>Fatal error: Using $this when not in object context in \/var\/www\/ez\/kernel\/classes\/ezcontentobjecttreenode.php on line 1954<\/code><\/p>\n<p>The solution is changing this line in the file <code>extension\/archive\/cronjobs\/archive.php<\/code>:<\/p>\n<p><code>39c39<br \/>\n&lt;\u00a0\u00a0\u00a0\u00a0 $nodes =&amp; eZContentObjectTreeNode::subTree( array( 'ClassFilterType' =&gt; 'include',<br \/>\n---<br \/>\n&gt;\u00a0\u00a0\u00a0\u00a0 $nodes =&amp; eZContentObjectTreeNode::subTreeByNodeIde( array( 'ClassFilterType' =&gt; 'include',<\/code><\/p>\n<p><strong>Image files don&#8217;t appear<\/strong><\/p>\n<p>Finally, a quite stupid mistake from my part: I just forgot to set the correct permissions to the eZ directory. Because of that, the program couldn&#8217;t write the temporary files it uses when resizing images and images in the page didn&#8217;t load. So remember your good friends <em>chown <\/em>and <em>chmod<\/em>.<\/p>\n<p><strong>Bonus: Online Editor v5<\/strong><\/p>\n<p>eZ Publish 4.1.0 adds some nice features, but it&#8217;s still in a beta state and we prefer a stable release in our server. Anyway, we&#8217;ve managed to install the latest Online Editor in the current version of eZ.<\/p>\n<p>To do it, we just took the Online Editor files from the eZ Publish 4.1.0beta release (directory <code>extension\/ezoe<\/code>), copied it to eZ 4.0.1 and activated the new extension modifying the file <code>settings\/override\/site.ini.append.php<\/code>:<\/p>\n<p><code>&lt; ActiveExtensions[]=ezhtml<br \/>\n&gt; ActiveExtensions[]=ezoe<br \/>\n<\/code><\/p>\n<p>Depending on the rewrite rules you have in your apache server, you could have to make this small change:<\/p>\n<p><code>&lt; RewriteRule ^\/var\/[^\/]+\/cache\/texttoimage\/.* - [L]<br \/>\n&gt; RewriteRule ^\/var\/[^\/]+\/cache\/(texttoimage|public)\/.* - [L]<br \/>\n<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Some weeks ago we upgraded our CMS, eZ Publish, to the latest version in that moment, 4.0.1, with the intention of leaving behind PHP4 and switching to PHP5, the only one supported by the 4.x series. And although there is &hellip; <a href=\"https:\/\/blogs.igalia.com\/jaragunde\/2009\/03\/adventures-upgrading-ez-publish-to-401\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":17,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,4,10],"tags":[13],"class_list":["post-23","post","type-post","status-publish","format-standard","hentry","category-ez-publish","category-intranet-education-coruna","category-web","tag-edu-coruna"],"_links":{"self":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/23","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/users\/17"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/comments?post=23"}],"version-history":[{"count":0,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/posts\/23\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/media?parent=23"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/categories?post=23"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.igalia.com\/jaragunde\/wp-json\/wp\/v2\/tags?post=23"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}