Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
rogamoore opened this issue Jun 18, 2024 · 3 comments · Fixed by sulu/sulu#7461
Closed

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

rogamoore opened this issue Jun 18, 2024 · 3 comments · Fixed by sulu/sulu#7461

Comments

@rogamoore
Copy link
Contributor

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:

  • Create new article, then save and publish - above commands still work fine
  • Now set the article to unpublished - above commands will fail (website context) with the error message as described before

Possible Solutions

  • Should unpublished articles even be included in the refresh? If not, a check should be added.
  • If yes, what should be done, because it looks some data is missing. I dumped the document and it doesn't even have a title.
@alexander-schranz
Copy link
Member

@rogamoore can you give sulu/sulu#7461 a try and check if it did fix your issue?

@rogamoore
Copy link
Contributor Author

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

@alexander-schranz
Copy link
Member

@rogamoore Thx for testing!

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

Successfully merging a pull request may close this issue.

2 participants