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.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chr.fritsch created an issue. See original summary.

chr.fritsch’s picture

chr.fritsch’s picture

Status: Active » Needs review

Status: Needs review » Needs work

The last submitted patch, 2: 3021005.patch, failed testing. View results

chr.fritsch’s picture

Status: Needs work » Needs review
FileSize
23.08 KB

Schema fixes

jonathan1055’s picture

Thanks 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.

chr.fritsch’s picture

I 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.

jonathan1055’s picture

chr.fritsch’s picture

Status: Needs review » Needs work
  1. +++ b/config/install/views.view.scheduler_scheduled_content.yml
    @@ -2,19 +2,25 @@ langcode: en
    +_core:
    +  default_config_hash: 76OtYhIMKqji7okkzD9dtqaYCZyBjJdRFOsqJB1DDls
    

    This shouldn't be there

  2. +++ b/config/install/views.view.scheduler_scheduled_content.yml
    @@ -54,7 +78,7 @@ display:
    -            title: title
    +            title_1: title_1
    

    Can we keep title instead of title_1?

jonathan1055’s picture

Yes 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.

chr.fritsch’s picture

Sure. I don't mind if my or your patch is used in the end. I am happy when we get the issue fixed. 😀

nsciacca’s picture

I 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.

jonathan1055’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
18.74 KB

I 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.

jds1’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
457.06 KB
395.44 KB

Looks good to me. Patch applies cleanly.

Here's a screenshot of the view before patch:

Scheduler View Before Patch

Here's a screenshot of the view after patch (just uninstalled/reinstalled Scheduler). You can see the revision stuff in there:

Scheduler View After Patch

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!

jonathan1055’s picture

Hi 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.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 15: 3021005-15.scheduled-content-view.patch, failed testing. View results

jonathan1055’s picture

Status: Needs work » Needs review
FileSize
19.48 KB
2.74 KB

The error with removing role names caused every test to fail

Drupal\Core\Config\Schema\SchemaIncompleteException: 
Schema errors for views.view.scheduler_scheduled_content with the following errors: views.view.scheduler_scheduled_content:display.default.display_options.filters.latest_revision.expose.remember_roles variable type is NULL but applied schema class is Drupal\Core\Config\Schema\Sequence

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.

jonathan1055’s picture

I 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.

jds1’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
518.17 KB

I 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!

  • jonathan1055 committed 3040247 on 8.x-1.x
    Issue #3021005 by jonathan1055, chr.fritsch, if-jds: Scheduler view...
jonathan1055’s picture

Status: Reviewed & tested by the community » Fixed

Thanks to chr.fritsch, if-jds and nsciacca.
Committed and fixed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.