Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

An item should not include both author and dc:creator #90

Open
2 tasks done
glen-84 opened this issue Oct 4, 2018 · 5 comments
Open
2 tasks done

An item should not include both author and dc:creator #90

glen-84 opened this issue Oct 4, 2018 · 5 comments
Labels

Comments

@glen-84
Copy link

glen-84 commented Oct 4, 2018

Using the W3C Feed Validation Service:

In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.
line 19, column 6: An item should not include both author and dc:creator (10 occurrences) [help]

      <dc:creator>Tina "jnienow" Pfannerstill</dc:creator>

Code to reproduce the issue

n/a

Expected results

Only one of author and dc:creator is included.

Actual results

Both are included.

@froschdesign
Copy link
Member

@glen-84
One option is to remove (deregister) the core extension DublinCore\Renderer\Feed from extension manager, but I think there was a problem.

We then have to check as well:

  • source and dc:source
  • category and dc:subject

I will have a deeper look into the code. Thanks for reporting!

@froschdesign
Copy link
Member

I think we must change the method Zend\Writer\Writer::registerCoreExtensions:

public static function registerCoreExtensions()
{
    $coreExtensions = [
        'Atom',
        'Content',
        'DublinCore',
        'GooglePlayPodcast',
        'ITunes',
        'Slash',
        'Threading',
        'WellFormedWeb',
    ];

    foreach ($coreExtensions as $coreExtension) {
        if (static::hasExtension($coreExtension)) {
            static::registerExtension($coreExtension);
        }
    }
}

With this change an extension can be removed (deregister):

$extensionManager = new Zend\Feed\Writer\StandaloneExtensionManager();
$extensionManager->remove('DublinCore\Renderer\Entry');
$extensionManager->remove('DublinCore\Renderer\Feed');
Zend\Feed\Writer\Writer::setExtensionManager($extensionManager);

@glen-84
Can you test this idea? Thanks in advance!

@glen-84
Copy link
Author

glen-84 commented Mar 8, 2019

@froschdesign,

It does seem to work, but shouldn't this be the default? (i.e. by default it shouldn't include both elements?)

@froschdesign
Copy link
Member

@glen-84
Thanks for your feedback! I will create a patch for it.

… by default it shouldn't include both elements?

It was implemented in zend-feed before 2012 and I do not know if there was already a recommendation for this elements to that time.
At the current point it is an BC break to change the current behaviour but we need a option to customize it.

@weierophinney
Copy link
Member

This repository has been closed and moved to laminas/laminas-feed; a new issue has been opened at laminas/laminas-feed#4.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants