Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The current scheduler_scheduled_content is based on the default revision. When it comes to content_moderation, that view would be better using the latest revisions, otherwise the scheduled content does not show up.
Proposed resolution
Rewrite the view based on node revision tables
Testing
The easiest way to test the new view is to use Config Inspector and Config Update modules. The report can show the difference between the existing view installed in the site and the new config .yml file. You can then 'revert to source' to update the view to match the changed file.
Comment | File | Size | Author |
---|---|---|---|
#19 | 3021005-19-1-after-patch-18.png | 518.17 KB | jds1 |
#18 | 3021005-18.scheduled-content-view.patch | 22.1 KB | jonathan1055 |
|
Comments
Comment #2
chr.fritschComment #3
chr.fritschComment #5
chr.fritschSchema fixes
Comment #6
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks for this. I presume you used an export feature to generate the schema changes? Therefore, could you go through the steps you did to actually change the view. Just reading the patch gives an idea, but would be good to hear what you actually did to the view.
Comment #7
chr.fritschI created a completely new view because the base table is different now.
Then I added all the fields, that er in the current view, and tried to configure the new view in the same way the old one was.
Comment #8
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHere is another patch for the same (or similar) view changes. It was originally add on #3049070-8: Load latest revision of node when publishing and unpublishing
Comment #9
chr.fritschThis shouldn't be there
Can we keep title instead of title_1?
Comment #10
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedYes I spotted the default_config_hash and thought it should be deleted. I also saw the title_1 bit, and that looks wrong. The new view seems to have both title and title_1.
I was not saying that the second patch is preferrable, just adding it here to allow us to compare. There may be good things in your patch that are not in the new one.
Comment #11
chr.fritschSure. I don't mind if my or your patch is used in the end. I am happy when we get the issue fixed. 😀
Comment #12
nsciaccaI authored that second patch on #3049070 before I saw this issue and the existing work of @chr.fritsch. The original patch in #5 works great and I think we can just stick with that.
Comment #13
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI have taken the patch from #5 and made a couple of changes to bring it closer into line with the existing view (e.g. turn node title into link to the node, have the same text for column headings). Trying to compare the existing and the new views.view.scheduler_scheduled_content.yml was difficult because things were exported in a different order. So I have moved various blocks of code, and individual lines, so that we can now compare directly the current and new config files. Here is a patch which shows quite clearly the changes being made. Lots of the changes are additions which are obviously correct. There are also a few changes whcih might need adjustment. But now we can easily see the differences.
The easiest way to test the new view is to use Config Inspector and Config Update modules. The report can show the difference between the existing view installed in the site and the new config .yml file. You can then 'revert to source' to update the view to match the changed file.
Comment #14
jds1Looks good to me. Patch applies cleanly.
Here's a screenshot of the view before patch:
Here's a screenshot of the view after patch (just uninstalled/reinstalled Scheduler). You can see the revision stuff in there:
Also created a scheduled item. Scheduler content view loaded fine. Added a revision to it with different title, new title shows on content view after saving.
Marking as RTBC!
Comment #15
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedHi if-jds
Thanks for the review, pleased to hear it is working for you.
I've done a little bit of tidying up of the view with this new patch, but only cosmetic and data cleaning. Essentially it should work the same as in #13. The changes put back some of the inadvertant differences made when the new view was created, and also make the export of the view code match the source. This will help in identifying future changes.
Comment #17
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThe error with removing role names caused every test to fail
This would seem to be a config update module 'export' fault, because the value exported from the view was 'null' which fails testing. So, the easiest thing is to put back the roles info. This is ok, because as soon as an admin clicked 'remember' all those role names would be exported anyway, and we do want to keep our view.yml close to the possible exported file.
Comment #18
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedI also noticed that the core content view has filter fields in the order: Title, Content type, Published status, Language. So there is no good reason why the Scheduled view should have them in a different order: Published status, Type, Title, Language.
Comment #19
jds1I ran through the same test process as before and this is looking good.
Here is what the view looked like after the patch in #13:
Here is what the view looks like after the patch in #18:
Schedule a revision, it shows on the view. Update the title/add a revision, updated title shows on the view.
RTBC!
Comment #21
jonathan1055 CreditAttribution: jonathan1055 as a volunteer commentedThanks to chr.fritsch, if-jds and nsciacca.
Committed and fixed.