ez projects / xrowmetadata / forum / general / error with differnent rootn...
You need to be logged in to post messages in the forums. New users may register here.
|
Member since: Posts: 12 |
Thursday 22 December 2011 12:15:04 pm Hi,
first of all really nice work;-). I found a but if your siteaccess have different RootNodes defined in different siteaccesses. settings/xrowsitemap.ini.append.php: AvailableSiteAccessList[] AvailableSiteAccessList[]=access1 AvailableSiteAccessList[]=access2 settings/siteaccess/access1/content.ini [NodeSettings] RootNode=1205 settings/siteaccess/access2/content.ini [NodeSettings] RootNode=1423 The problem in extension/xrowmetadata/classes/xrowsitemaptools.php in line 461: $node_id = eZINI::instance( 'content.ini' )->variable( 'NodeSettings', 'RootNode' ); It seems like changing the siteaccess has no affect on the eZINI::instance. So $node_id remains the same value as set in the very first siteaccess. A quick fix for me worked for now, but i thought that eZINI::instance takes care about the current siteaccess! --- a/extension/xrowmetadata/classes/xrowsitemaptools.php +++ b/extension/xrowmetadata/classes/xrowsitemaptools.php @@ -288,6 +288,9 @@ class xrowSitemapTools public static function createSitemap() { eZDebug::writeDebug( "Generating Standard Sitemap ...", __METHOD__ ); + + self::$rootNode=null; + eZContentLanguage::expireCache(); $cli = $GLOBALS['cli']; global $cli, $isQuiet; @@ -458,7 +461,8 @@ public static $rootNode; { if( self::$rootNode === null ) { - $node_id = eZINI::instance( 'content.ini' )->variable( 'NodeSettings', 'RootNode' ); + $node_id = + eZINI::instance('content.ini.append.php',"settings/siteaccess/".$GLOBALS['eZCurrentAccess']['name'])->variable( 'NodeSettings', 'RootNode' ); $rootNode = eZContentObjectTreeNode::fetch( $node_id ); if ( ! $rootNode instanceof eZContentObjectTreeNode ) greetz Andi --------------------------------------- |
|
Member since: Posts: 47 |
Thursday 05 January 2012 7:08:55 pm This patch is invalid for the described problem.
The ID can`t be loaded like that eZINI::instance('content.ini.append.php',"settings/siteaccess/".$GLOBALS['eZCurrentAccess']['name'])->variable( 'NodeSettings', 'RootNode' ); Looking for a new job? http://www.xrow.com/xrow-GmbH/Jobs |
|
|
Member since: Posts: 12 |
Monday 09 January 2012 9:37:12 am Hi Björn,
the formatting of the code was not nice so I modified the patch. Fetching the node_id works like this: $node_id = eZINI::instance('content.ini.append.php',"settings/siteaccess/".$GLOBALS['eZCurrentAccess']['name'])->variable( 'NodeSettings', 'RootNode' ); Patch: --- a/extension/xrowmetadata/classes/xrowsitemaptools.php +++ b/extension/xrowmetadata/classes/xrowsitemaptools.php @@ -288,6 +288,9 @@ class xrowSitemapTools public static function createSitemap() { eZDebug::writeDebug( "Generating Standard Sitemap ...", __METHOD__ ); + + self::$rootNode=null; + eZContentLanguage::expireCache(); $cli = $GLOBALS['cli']; global $cli, $isQuiet; @@ -458,7 +461,7 @@ public static $rootNode; { if( self::$rootNode === null ) { - $node_id = eZINI::instance( 'content.ini' )->variable( 'NodeSettings', 'RootNode' ); + $node_id = eZINI::instance('content.ini.append.php',"settings/siteaccess/".$GLOBALS['eZCurrentAccess']['name'])->variable( 'NodeSettings', 'RootNode' ); $rootNode = eZContentObjectTreeNode::fetch( $node_id ); if ( ! $rootNode instanceof eZContentObjectTreeNode ) --------------------------------------- |
You need to be logged in to post messages in the forums. New users may register here.