Skip to content
Permalink
Browse files

Fixed bug #017685: RSS GUID is not persistent

  • Loading branch information...
Lukasz Serwatka
Lukasz Serwatka committed Jan 12, 2011
1 parent 204563c commit b28477865296144edf7efd1b745d4794c1413697
@@ -24,7 +24,8 @@ Changes from 4.4.0 to 4.5.0alpha1
- Fixed bug #017632: Wrong language used for URL alias with a non-default language node
- Fixed bug #017616: security policy node/subtree limitation bug
- Fixed bug #017684: eZDFSFileHandler::purge with a directory doesn't purge local files
- Fixed bug #017685: RSS GUID is not persistent
- Fixed bug #017686: ezdatetime "use seconds" is not supported in admin2 templates
- Fixed bug #017822: A useless update query is executed on ezcontentobject_tree during publishing
- Fixed bug #017761: ezcache.php --purge does not purge template-blocks
- Fixed bug #017703: Fatal error when deleting main node having ezfind enabled
- Fixed bug #017703: Fatal error when deleting main node having ezfind enabled
@@ -983,7 +983,15 @@ function generateFeed( $type )
$link = $item->add( 'link' );
$link->href = $nodeURL;
$item->id = $nodeURL;
switch ( $type )
{
case 'rss2':
$item->id = $object->attribute( 'remote_id' );
$item->id->isPermaLink = false;
break;
default:
$item->id = $nodeURL;
}
$itemCreatorObject = $node->attribute('creator');
if ( $itemCreatorObject instanceof eZContentObject )
@@ -16,7 +16,7 @@
<link>http://@ezp_server@/testCreateRSS2With1Items/Test-object-0-for-testCreateRSS2With1Items</link>
<description>&lt;p&gt;Summary for Test object #0 for testCreateRSS2With1Items&lt;/p&gt;</description>
<author>@ezp_admin_email@ (Administrator User)</author>
<guid>http://@ezp_server@/testCreateRSS2With1Items/Test-object-0-for-testCreateRSS2With1Items</guid>
<guid isPermaLink="false">894c0959925a6ac47c915b7c8fb6376c</guid>
<pubDate>XXX</pubDate>
</item>
</channel>
@@ -16,7 +16,7 @@
<link>http://@ezp_server@/testCreateRSS2With2Items1Hidden/Test-object-0-for-testCreateRSS2With2Items1Hidden</link>
<description>&lt;p&gt;Summary for Test object #0 for testCreateRSS2With2Items1Hidden&lt;/p&gt;</description>
<author>@ezp_admin_email@ (Administrator User)</author>
<guid>http://@ezp_server@/testCreateRSS2With2Items1Hidden/Test-object-0-for-testCreateRSS2With2Items1Hidden</guid>
<guid isPermaLink="false">894c0959925a6ac47c915b7c8fb6376c</guid>
<pubDate>XXX</pubDate>
</item>
</channel>
@@ -47,6 +47,7 @@ public function setUp()
$this->ezp_admin_email = $admin->attribute('email');
$this->test_data_folder = dirname( __FILE__ ) . DIRECTORY_SEPARATOR . 'ezrss' . DIRECTORY_SEPARATOR;
$this->remote_id_map = array( '894c0959925a6ac47c915b7c8fb6376c', '935f192b93cbadbbf93d7b031bdceb70' );
}
/**
@@ -85,13 +86,17 @@ public function createEZPFolder( $folderName )
* @param string $articleIntro
* @return int The ID of the article created
*/
public function createEZPArticle( $folderId, $articleTitle, $articleIntro )
public function createEZPArticle( $folderId, $articleTitle, $articleIntro, $articleRemoteID )
{
$object = new ezpObject( 'article', $folderId );
$object->title = $articleTitle;
$object->intro = $articleIntro;
$object->publish();
// Update object RemoteID
$object->setAttribute( 'remote_id', $articleRemoteID );
$object->store();
$objectId = (int)$object->attribute( 'id' );
return $objectId;
}
@@ -177,7 +182,8 @@ public function testCreateRSS1With1Items()
{
$this->createEZPArticle( $folderId,
"Test object #{$i} for " . __FUNCTION__,
"Summary for Test object #{$i} for " . __FUNCTION__ );
"Summary for Test object #{$i} for " . __FUNCTION__,
$this->remote_id_map[$i] );
}
$rssExport = $this->createEZPRSSExport( '1.0', $folderId, 'RSS 1.0 feed', 'This feed is of <b>RSS 1.0</b> type.' );
@@ -196,7 +202,8 @@ public function testCreateRSS2With1Items()
{
$this->createEZPArticle( $folderId,
"Test object #{$i} for " . __FUNCTION__,
"Summary for Test object #{$i} for " . __FUNCTION__ );
"Summary for Test object #{$i} for " . __FUNCTION__,
$this->remote_id_map[$i] );
}
$rssExport = $this->createEZPRSSExport( '2.0', $folderId, 'RSS 2.0 feed', 'This feed is of <b>RSS 2.0</b> type.' );
@@ -215,7 +222,8 @@ public function testCreateATOMWith1Items()
{
$this->createEZPArticle( $folderId,
"Test object #{$i} for " . __FUNCTION__,
"Summary for Test object #{$i} for " . __FUNCTION__ );
"Summary for Test object #{$i} for " . __FUNCTION__,
$this->remote_id_map[$i] );
}
$rssExport = $this->createEZPRSSExport( 'ATOM', $folderId, 'ATOM feed', 'This feed is of <b>ATOM</b> type.' );
@@ -238,7 +246,8 @@ public function testCreateRSS1With2Items1Hidden()
{
$ids[] = $this->createEZPArticle( $folderId,
"Test object #{$i} for " . __FUNCTION__,
"Summary for Test object #{$i} for " . __FUNCTION__ );
"Summary for Test object #{$i} for " . __FUNCTION__,
$this->remote_id_map[$i] );
}
$this->hideObject( $ids[1] );
@@ -263,7 +272,8 @@ public function testCreateRSS2With2Items1Hidden()
{
$ids[] = $this->createEZPArticle( $folderId,
"Test object #{$i} for " . __FUNCTION__,
"Summary for Test object #{$i} for " . __FUNCTION__ );
"Summary for Test object #{$i} for " . __FUNCTION__,
$this->remote_id_map[$i] );
}
$this->hideObject( $ids[1] );
@@ -288,7 +298,8 @@ public function testCreateATOMWith2Items1Hidden()
{
$ids[] = $this->createEZPArticle( $folderId,
"Test object #{$i} for " . __FUNCTION__,
"Summary for Test object #{$i} for " . __FUNCTION__ );
"Summary for Test object #{$i} for " . __FUNCTION__,
$this->remote_id_map[$i] );
}
$this->hideObject( $ids[1] );
@@ -315,7 +326,8 @@ public function testCreateATOMWithnbsp()
{
$ids[] = $this->createEZPArticle( $folderId,
"Test object #{$i} for " . __FUNCTION__,
"Summary for Test object #{$i} for " . __FUNCTION__ . " & with a nbsp char right here&nbsp;." );
"Summary for Test object #{$i} for " . __FUNCTION__ . " & with a nbsp char right here&nbsp;.",
$this->remote_id_map[$i] );
}
$rssExport = $this->createEZPRSSExport( 'ATOM', $folderId, 'ATOM feed', 'This feed is of <b>ATOM</b> type.' );

0 comments on commit b284778

Please sign in to comment.
You can’t perform that action at this time.