Follow-up to #2409413: Remove fields that do nothing from the "RSS publishing" settings form

Problem/Motivation

'title' is a special view mode hacked into the plugins. The default view mode 'rss' is provided by core but once you change the form you can never re-select. The teaser view mode might exist. The fulltext view mode almost certainly does not. I think we should fix all the view mode wonky-ness in another patch as it is likely to be hard. Basically, the whole view mode setting is currently very broken :(

    $form['feed_view_mode'] = array(
      '#type' => 'select',
      '#title' => t('Feed content'),
      '#default_value' => $this->config('system.rss')->get('items.view_mode'),
      '#options' => array(
        'title' => t('Titles only'),
        'teaser' => t('Titles plus teaser'),
        'fulltext' => t('Full text'),
      ),
      '#description' => t('Global setting for the default display of content items in each feed.')
    );

And the default value is RSS :(

Oh and the views are missing dependencies on the correct view mode if the default system view mode is used. What a mess.

Proposed resolution

Remove the rss viewmode setting from core and provide a path to migrate sites away from this.

Remaining tasks

User interface changes

API changes

Issue fork drupal-2601030

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

alexpott created an issue. See original summary.

alexpott’s picture

Status: Active » Needs review
StatusFileSize
new7.23 KB

Here's a firs cut... upgrade path for views still to think about and test.

alexpott’s picture

Another problem here is the hard coding of the title view mode - this is not a reserved word so a user could add a view mode called title and things would start to behave interestingly.

Status: Needs review » Needs work

The last submitted patch, 2: 2601030-2.patch, failed testing.

alexpott’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: +Needs tests
StatusFileSize
new3.33 KB
new9.55 KB

New patch handles the potential title view mode clash.

Status: Needs review » Needs work

The last submitted patch, 5: 2601030-5.patch, failed testing.

alexpott’s picture

StatusFileSize
new928 bytes
new10.17 KB

Fixing the fails. Also another reason why default is a bad name for the pseudo view modes configured by system.rss - the default view mode is provided by standard...

alexpott’s picture

Status: Needs work » Needs review

The last submitted patch, 2: 2601030-2.patch, failed testing.

The last submitted patch, 5: 2601030-5.patch, failed testing.

dawehner’s picture

Component: base system » system.module

Moving out of base system.

+++ b/core/modules/node/src/Plugin/views/row/Rss.php
@@ -68,8 +68,7 @@ public function __construct(array $configuration, $plugin_id, $plugin_definition
+    $options['_views.rss.title'] = $this->t('Title only');

This underscore feels a little bit odd, given that nothing seems to be using it?

xjm’s picture

I don't understand this issue from the summary. Some STR might help, as it currently reads as though it's removing an important feature. The summary should also document the case for making this change during RC and what the impacts/disruptions are. Thanks!

catch’s picture

Title: Remove the system.rss:items.view_mode » Views RSS view mode settings are completely broken

Updating the title for now.

xjm’s picture

Issue tags: -rc target triage

 

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.3.x-dev » 8.4.x-dev

Drupal 8.3.6 was released on August 2, 2017 and is the final full bugfix release for the Drupal 8.3.x series. Drupal 8.3.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.4.0 on October 4, 2017. (Drupal 8.4.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.4.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.5.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.6.x-dev » 8.8.x-dev

Drupal 8.6.x will not receive any further development aside from security fixes. Bug reports should be targeted against the 8.8.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.9.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

longwave’s picture

Version: 8.9.x-dev » 9.2.x-dev
StatusFileSize
new12.52 KB

Rerolled following #2409413: Remove fields that do nothing from the "RSS publishing" settings form, but this still needs an upgrade path and tests. We can remove the entire RSS publishing config form now.

Status: Needs review » Needs work

The last submitted patch, 23: 2601030-23.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new13.03 KB
new529 bytes

Added post_update hook to delete the config entirely. Not sure what we should do about the pre-existing system_post_update_delete_rss_settings(), if anything.

Status: Needs review » Needs work

The last submitted patch, 25: 2601030-25.patch, failed testing. View results

longwave’s picture

Status: Needs work » Needs review
StatusFileSize
new14.42 KB
new1.73 KB

Added a test and fixed the other update tests by removing the previous post_update hook code.

Still needs an upgrade path.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.3.x-dev » 9.4.x-dev

Drupal 9.3.0-rc1 was released on November 26, 2021, which means new developments and disruptive changes should now be targeted for the 9.4.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 9.4.x-dev » 9.5.x-dev

Drupal 9.4.0-alpha1 was released on May 6, 2022, which means new developments and disruptive changes should now be targeted for the 9.5.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

anybody’s picture

Version: 9.5.x-dev » 10.1.x-dev

Drupal 9.5.0-beta2 and Drupal 10.0.0-beta2 were released on September 29, 2022, which means new developments and disruptive changes should now be targeted for the 10.1.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

needs-review-queue-bot’s picture

Status: Needs review » Needs work
StatusFileSize
new144 bytes

The Needs Review Queue Bot tested this issue. It either no longer applies to Drupal core, or fails the Drupal core commit checks. Therefore, this issue status is now "Needs work".

Apart from a re-roll or rebase, this issue may need more work to address feedback in the issue or MR comments. To progress an issue, incorporate this feedback as part of the process of updating the issue. This helps other contributors to know what is outstanding.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bbrala made their first commit to this issue’s fork.

bbrala’s picture

Pushed to a MR with some small changes.

Upgrade path is tested afaik, so removing that tag. Has tests it seems, so removing that tag also. Did small update to IS, but don't see how we can make this more clear.

This will need a CR though. Dont think we need to deprecate anything really, since this is pretty much broken functionality you cant rely on.

bbrala’s picture

Added a change record.

All tests are green. Which is great.

Not sure about the upgrade path. I'll ask around

bbrala’s picture

longwave’s picture

Any existing views that have default as the RSS view mode need to be updated so they store whatever the default value actually was, before we delete that value from config. The default value is likely broken in many cases but doing this won't make it any more broken nor will it break existing sites that by coincidence do have it working for some reason, e.g if the default is teaser and they do have a teaser view mode.

bbrala’s picture

bbrala’s picture

Well, seems i have a working test. While going through the motions i did find a one more view that use default still.

views.view.taxonomy_term.yml

      row:
        type: node_rss
        options:
          relationship: none
          view_mode: default

Also a little confused. If i look at system.rss.yml the default should be rss i think, since that was in the config. But when running the update test it gets set to title, i really don't understand how that is possible. What am i missing there?

bbrala’s picture

Status: Needs work » Needs review

fixed tests, so setting to NR

catch’s picture

Left a couple of (reasonably horrible) questions on the MR.

longwave’s picture

Status: Needs review » Needs work

Responded to @catch's review, NW for these changes.

bbrala’s picture

I've got some questions about your approach, there might be more gotcha's (and possibly a bug :P)

bbrala’s picture

Status: Needs work » Needs review
bbrala’s picture

Status: Needs review » Needs work

Still need to handle 2 things:

  1. When default is the viewmode, and we have no config this will keep updateing to the first key. What if there is actually a viewmode that is called default, do we keep that?
  2. Run this onSave
bbrala’s picture

Status: Needs work » Needs review

Now running on onSave in the updateAll method.

Also added an extra check for when we have no reference from system.rss and there is an available view_mode called default.

bbrala’s picture

Made selection code better and added comments on how it works.

Getting a failure on the Configuration tests. But not sure why, perhaps because the fixtures need to change since default config changed for taxonomy config?

mstrelan’s picture

Opened #3522801: Deprecate RSS usage in core to discuss if we want to deprecate RSS more broadly in core

longwave’s picture

Status: Needs review » Reviewed & tested by the community

Fixed a typo in the comments but otherwise this looks great, thanks for working through the pain of the update hooks and adding the test coverage for that - glad to see the back of this finally.

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

bbrala’s picture

Status: Needs work » Reviewed & tested by the community

Bot is broken

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

longwave’s picture

GitLab also says there is a merge conflict?

bbrala’s picture

Oh, will rebase later today.

bbrala’s picture

Status: Needs work » Reviewed & tested by the community
alexpott’s picture

Status: Reviewed & tested by the community » Needs work

We have two modules that will need issues against when we remove system.rss. https://www.drupal.org/project/knowledge and https://www.drupal.org/project/support - the Knowledge project is the only one with a stable release against 11.x ... some other modules will require updating but it is

The change record needs to be updated to explicit mention that system.rss is going away and what modules should do to replace it. Setting to needs work to address this. Once done can be rtbc'd again.

alexpott’s picture

Search link that found the modules that need fixes... http://codcontrib.hank.vps-private.net/search?text=system.rss&filename=

bbrala’s picture

I normally search like this: https://git.drupalcode.org/search?group_id=2&scope=blobs&search=-path%3A...

Since when are we opening issues on contrib projects for deprecations/removal? I've not seen that before :)

bbrala’s picture

Updated CR

bbrala’s picture

Status: Needs work » Reviewed & tested by the community

Mis understood, RTBC was referring to the change record.

But still made 2 child issues for those modules.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

Missing docs...

I keep on pondering whether we should decouple the config removal from the other changes here. Like decouple views RSS and make the system config completely unused and deprecated and then remove that in a separate 12.x issue. I would mean that we also have the previous value around for module updates.

Not sure - going to ping @catch and @longwave for thoughts.

bbrala’s picture

Added the requested docs.

bbrala’s picture

bbrala’s picture

Status: Needs work » Reviewed & tested by the community

Gonna try again.

Failures were just blips. Setting back to RTBC

needs-review-queue-bot’s picture

Status: Reviewed & tested by the community » Needs work
StatusFileSize
new91 bytes

The Needs Review Queue Bot tested this issue. It no longer applies to Drupal core. Therefore, this issue status is now "Needs work".

This does not mean that the patch necessarily needs to be re-rolled or the MR rebased. Read the Issue Summary, the issue tags and the latest discussion here to determine what needs to be done.

Consult the Drupal Contributor Guide to find step-by-step guides for working with issues.

rpayanm made their first commit to this issue’s fork.

bbrala’s picture

Status: Needs work » Reviewed & tested by the community

Rebased and resolved the small conflicts. Also fixed phpunit annotation, those needed changing.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work

So close... I think we need to change the update function a little bit to make sense when it is called several times as part of a batch.

bbrala’s picture

Status: Needs work » Reviewed & tested by the community

Implemented the small fix by @alexpott

Setting to RTBC because fix is small

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 90d56c4 and pushed to 11.x. Thanks!

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.

  • alexpott committed 90d56c46 on 11.x
    Issue #2601030 by alexpott, catch, longwave, bbrala: Views RSS view mode...
bbrala’s picture

Yay! Thank you guys. This was a hard one :)

Status: Fixed » Closed (fixed)

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