in2code-de / in2publish_core

in2publish Community Version
https://www.in2code.de/produkte/content-publisher/
GNU General Public License v3.0
40 stars 23 forks source link

[BUGFIX] Fix publishbackgroundall dependency index #121

Closed dreistromlandMf closed 2 weeks ago

dreistromlandMf commented 1 month ago

The command in2publish:workflow:publishbackground from the premium plugin may skip pages depending on previous pages:

  1. Assume a page and a child page are scheduled for publishing.
  2. Assume the child page gets processed first.
  3. The child page will fetch the parent page as a dependency. The parent page will get recorded in the index.
  4. When the parent page record gets fetched from the database, it will already be in the index. It will not get added to any record index recording.
  5. The RecordTreeBuilder assumes that pages scheduled for publishing get added to the record index recording buildRecordTree, which did not happen in step 4.
  6. The parent page gets marked as published, but changes will not actually have been published.

This commit ensures the parent page gets added to the buildRecordTree record index recording. It archives that by adding pages to the record index recording even if it was already in the index.

As this code is pretty deep, I am not quite sure about unintended side effects. Intense testing is advisable.

sbusemann commented 3 weeks ago

https://projekte.in2code.de/issues/67679

tinzog commented 2 weeks ago

Thank you very much for supplying this helpful PR. We are currently testing for unintended side effects.

tinzog commented 2 weeks ago

We could reproduce the problem and tested the PR successfully. Thanks for your investigation and support.