sulu / SuluArticleBundle

Bundle for managing localized content-rich entities like blog-posts in the Sulu content management system
MIT License
52 stars 77 forks source link

New sulu:reference:refresh command fails on unpublished articles #680

Closed rogamoore closed 2 weeks ago

rogamoore commented 2 weeks ago
Q A
Bug? yes
New Feature? no
SuluArticleBundle Version 2.6.0
Sulu Version 2.6.2

Actual Behavior

Running the new sulu:reference:refresh command fails when there are unpublished articles.

bin/websiteconsole sulu:reference:refresh

Refresh snippets
----------------

    2 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓]

Refresh pages
-------------

   16 [▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓]

Refresh articles
----------------

    2 [▓░░░░░░░░░░░░░░░░░░░░░░░░░░░]
In StructureManager.php line 69:

  Sulu\Component\Content\Compat\StructureManager::wrapStructure(): Argument #2 ($structure) must be of type Sulu\Component\Content\Metadata\StructureMetadata, null given, called
   in ../sulu-demo/vendor/sulu/sulu/src/Sulu/Component/Content/Compat/StructureManager.php on line 54

sulu:reference:refresh [<resource-key>]

Expected Behavior

Does not fail.

Steps to Reproduce

Run

bin/adminconsole sulu:reference:refresh
bin/websiteconsole sulu:reference:refresh

It should work fine.

Now follow these steps:

Possible Solutions

alexander-schranz commented 2 weeks ago

@rogamoore can you give https://github.com/sulu/sulu/pull/7461 a try and check if it did fix your issue?

rogamoore commented 2 weeks ago

@alexander-schranz I just tried and can confirm it's fixed. Thanks a lot!

alexander-schranz commented 2 weeks ago

@rogamoore Thx for testing!