Skip to content

RSS Feed - first load not working #25211

Closed
@JuraseQ

Description

@JuraseQ

Preconditions (*)

  1. Magento 2.3.x & 2.3-develop
  2. PHP 7.2.21 (i believe any other version too).

Steps to reproduce (*)

  1. Enable standard RSS Feed module.

  2. Enable RSS Feed for New Products and Special Products.
    2020-07-21_16-10-30

  3. Proceed to domain.tld/rss
    image

  4. Choose any channel.(New product in my case)

  5. We get an exception
    image

  6. Refresh of site will make RSS Feed work. The point is that it's not working every time after compile.
    image

Expected result (*)

  1. Module should output XML file

Actual result (*)

1 exception(s):
Exception #0 (Zend\Feed\Writer\Exception\InvalidArgumentException): Invalid parameter: parameter must be a non-empty string

What i found (*)

I debugged it and in Zend\Feed\Writer\AbstractFeed in method setTitle there is condition:
if ((empty($title) && ! is_numeric($title)) || ! is_string($title)) { throw new Exception\InvalidArgumentException('Invalid parameter: parameter must be a non-empty string'); }

$title is an instance of 'Magento\Framework\Phrase' that is why it's throwing an exception.
When i changed the condition to:

if ((empty($title) && ! is_numeric($title)) || (! is_string($title) && strpos(get_class($title), 'Magento\Framework\Phrase') === false)) {

I tried this way just temporary for tests but it will require to modify data before it will reach Zend's library method.

Metadata

Metadata

Labels

Component: RssFixed in 2.4.xThe issue has been fixed in 2.4-develop branchIssue: Clear DescriptionGate 2 Passed. Manual verification of the issue description passedIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedIssue: Format is validGate 1 Passed. Automatic verification of issue format passedIssue: Ready for WorkGate 4. Acknowledged. Issue is added to backlog and ready for developmentPriority: P3May be fixed according to the position in the backlog.Reproduced on 2.3.xThe issue has been reproduced on latest 2.3 releaseReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S3Affects non-critical data or functionality and does not force users to employ a workaround.Triage: DoneHas been reviewed and prioritized during Triage with Product Managers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions