Issues

ZF-2140: Zend_Feed (RSS) Does Not Provide Access To content:encoded

Issue Type: Bug Created: 2007-11-02T13:24:16.000+0000 Last Updated: 2008-03-21T16:25:29.000+0000 Status: Resolved Fix version(s): - 1.5.0 (17/Mar/08)

Reporter: Lee (scrasher) Assignee: Simone Carletti (weppos) Tags: - Zend_Feed

Related issues: Attachments: - RSS-Feed.diff

Description

Zend_Feed::RSS does not provide access to the data of each RSS feed item. This is the main item holding the XHTML content of each RSS item in a feed. From what i can tell, the code attempts to parse it, but either provides no mechanism to access it (i.e. $item->content()) or improperly parses it such that that block is always returned as "".

You should be able to do:

$item->content() and get the xhtml content of the tag. Without this ability, parsing most RSS feeds becomes essentially useless.

Comments

Posted by Kevin Golding (caomhin) on 2008-01-24T11:26:19.000+0000

This isn't really a bug, more a usability issue.

$item->content() will always be empty because content is the namespace.

$item->encoded() returns the value of because the actual element is - basically the parser strips the namespace.

Altering this behaviour would be a bad idea since we should always have access to $item->encoded() to ensure consistency within the system.

This definitely needs documenting more clearly to ensure no confusion with this, or other namespaces.

However we should consider setting up an alias so that $item->content() will return to ensure consistency with feed creation (we set using $dataentry->content currently)

So not broken, and not very serious, but a serious contender for a feature enhancement to maximise consistency and minimise confusion.

Posted by Kevin Golding (caomhin) on 2008-01-24T12:21:23.000+0000

Meh, shouldn't make such suggestions without offering up a patch I guess...

Posted by Wil Sinclair (wil) on 2008-02-11T14:05:29.000+0000

There is a workaround (actually the correct usage), so this seems like a should have- or maybe even a nice-to-have- to me. Perhaps we should log another issue for fixing the docs in 1.0.4 for this, and creating the alias (and updating the docs) for 1.5. Simone, what do you think? And will you be able to get to this in the next couple of days if you intend to fix it. If not, please unassign it since we are getting very close to the code freeze dates for 1.0.4 and 1.5 RC1.

Thanks. ,Wil

Posted by Simone Carletti (weppos) on 2008-02-11T14:12:32.000+0000

The patch is ready since the beginning of February but I haven't created consistent test cases yet. I will take the time to fix it until tomorrow. If not, I will unassign it and follow your suggestions. :)

Posted by Simone Carletti (weppos) on 2008-02-11T15:43:55.000+0000

Hi Wil, I just noticed the example in the English documentation is incomplete.

The code is missing the __call implementation.

<pre class="highlight">
    public function __call($var, $unused)
    {
        switch ($var) {
            case 'myUpdated':
                // Translate myUpdated to myns:updated.
                return parent::__call('myns:updated', $unused);

            default:
                return parent::__call($var, $unused);
            }
    }

Additionally, I would change

<pre class="highlight">
<?php
$entry = new MyEntry();
$entry->myUpdated = '2005-04-19T15:30';

into

<pre class="highlight">

<?php
$entry = new MyEntry();
$entry->myUpdated = '2005-04-19T15:30';

// method style call is handled by __call function
$entry->myUpdated();  
// property style call is handled by __get function
$entry->myUpdated;

Because English it not my mother language could you please give a check to the modification above and let me know if they are grammatically corrected?

Posted by Simone Carletti (weppos) on 2008-02-11T16:52:41.000+0000

fixed in r7933. I wait a feedback on my previous comment before closing the issue.

Posted by Wil Sinclair (wil) on 2008-02-13T17:01:05.000+0000

If you're talking about the comments in the PHP code, they all look good to me. The only minor comment is that I would write method-style and property-style instead of 'method style' and 'property style'.

Posted by Simone Carletti (weppos) on 2008-02-14T14:16:35.000+0000

definitely closed in r8008

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts