Comments (9)
@podcasthosting
The method is far from perfect and leads to unexpected behaviour at the moment. A clean and well-defined API is needed to avoid problems like the current one.
Adds all 3 categories to the feed (as expected). Right now it partly works like an
addItunesCategory
method.
And this behaviour is wrong. setItunesCategories
should set the categories in whole and should overwrite all previous categories.
But at this point, we cannot change the current behaviour because this could break the current running applications.
from laminas-feed.
$feed->setItunesCategories(['Arts' => 'Food']); $feed->setItunesCategories(['Arts' => 'Visual Arts']);
The usage is wrong because the method sets all categories for the feed and a second call overwrites all previous categories. You expect the functionality of a method like addItunesCategory
but it does not exist.
Use the following:
$feed->setItunesCategories(['Arts' => ['Food', 'Visual Arts']]);
from laminas-feed.
But why does it work with categories with a different main category?
$feed->setItunesCategories(['Arts' => 'Food]);
$feed->setItunesCategories(['Business']);
$feed->setItunesCategories(['Comedy' => 'Comedy Interviews']);
Adds all 3 categories to the feed (as expected). Right now it partly works like an addItunesCategory
method.
from laminas-feed.
Thank you for clarification!
from laminas-feed.
@podcasthosting
I would leave the issue report open because the API can be improved with the next major version. That's why I had added the milestone.
from laminas-feed.
This actually also does not work:
$feed->setItunesCategories(['Comedy' => ['Improv', 'Comedy Interviews']]);
The result is:
<itunes:category text="Comedy">
<itunes:category text="Improv"/>
<itunes:category text="Comedy Interviews"/>
</itunes:category>
but should be:
<itunes:category text="Comedy">
<itunes:category text="Improv"/>
</itunes:category>
<itunes:category text="Comedy">
<itunes:category text="Comedy Interviews"/>
</itunes:category>
So this is completely broken and a pretty severe bug (from our customers` point of view).
from laminas-feed.
but should be:
<itunes:category text="Comedy"> <itunes:category text="Improv"/> </itunes:category> <itunes:category text="Comedy"> <itunes:category text="Comedy Interviews"/> </itunes:category>
Can you provide a reference / documentation for this? Thanks in advance! π
from laminas-feed.
@podcasthosting
Another idea is to use the corresponding XML schemas in the unit tests, so the schemas will also help here.
from laminas-feed.
@podcasthosting
Did you find some reference or documentation for this topic?
from laminas-feed.
Related Issues (20)
- Add usage in a Mezzio application for laminas-feed
- Workaround for blocked Laminas user agent HOT 1
- itunes:explicit values have changed HOT 3
- Getting "failed to open stream: No such file or directory in /autoload.php on line 5" when loading package HOT 5
- Atom Feed canβt read Entry content if type is application/xml
- Replace usage of deprecated libxml_disable_entity_loader() HOT 2
- Psalm integration HOT 2
- PHP 8.0 support HOT 1
- PHPDoc return types incorrect/outdated HOT 1
- Method getDateModified of RSS reader doesn't iterate over different formats HOT 2
- PubSubHubbub/Publisher not sending requests to hubs
- Laminas-http mishandles multiple headers causing failure HOT 2
- feedLink() is broken, returns invalid data if not found HOT 3
- CRLF in vendor/laminas/laminas-feed/CHANGELOG.md HOT 5
- Add code example for feed-writer to add a media object via the enclosure element
- Dependency Dashboard
- Error 500 when rendering a feed with some set*() methods HOT 2
- Add support for laminas/laminas-servicemanager 4.0 so this library can be used on PHP 8.2 + psr/container 2.0. HOT 4
- DateTime::createFromFormat(): Argument #2 ($datetime) must be of type string, bool given HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from laminas-feed.