Cannot save Views admin settings due to skip_cache error

Created on 27 May 2024, 11 months ago
Updated 29 May 2024, 11 months ago

Problem/Motivation

Extremely bewildering and frustrating problem where, if I go to admin/structure/views/settings, change an option, and then click "Save configuration", I get the following error:

Error message
'skip_cache' is not a supported key.

...and then my changes don't save. I don't even know where to start investigating the possible cause because all the searches I've done so far offer no insight. This seems the closest - https://www.drupal.org/project/drupal/issues/2541074 πŸ“Œ Get rid of using 'views.settings':skip_cache in ViewsData Fixed - but there's nothing I can see about this particular skip_cache glitch. I've also checked admin/reports/dblog and there's nothing there either.

Steps to reproduce

  1. Go to admin/structure/views/settings
  2. Change an option, e.g. "Show the SQL query"
  3. Click "Save configuration"

You'll get the error above. It will look as if the change was saved, but if you navigate away from admin/structure/views/settings and then go back to it, you'll see whatever change you made got reverted. I'm on Drupal version 10.2.6 (Pantheon multidev, though I suspect the problem will also occur on our main site because I haven't made any changes to this multidev which should result in this error).

Has anyone else ever run into this? Any ideas what else I could check or change? I'm honestly not sure if this is an issue with how our site is set up (I can't think of anything offhand) or a bug within Views itself. I'm not a Drupal programmer so I'd prefer to resolve this without the use of custom modules if possible.

πŸ› Bug report
Status

Active

Version

10.2 ✨

Component
ViewsΒ  β†’

Last updated about 5 hours ago

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • Status changed to Postponed: needs info 11 months ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Did you run updates? That setting was removed in πŸ“Œ Get rid of using 'views.settings':skip_cache in ViewsData Fixed

  • If you mean database updates, admin/reports/status shows them as already up to date and going to /update.php tells me there are no pending updates. Is there some other step I need to take?

  • πŸ‡ΊπŸ‡ΈUnited States mortona2k Seattle

    I had the same problem on a site created 3 months ago. I think it was on 10.2 and updated to 10.3.

    No pending updates. I'm not sure if they ran before or something else happened.

    I fixed it with drush cedit. Edit views.settings and remove the skip_cache line.

  • πŸ‡¬πŸ‡§United Kingdom catch

    The most likely way this could happen is if:

    1. A site was originally installed on a version that had this setting, with config exported to the config/sync directory.

    2. Site is updated to a version with πŸ“Œ Get rid of using 'views.settings':skip_cache in ViewsData Fixed applied.

    3. Database updates are run, but then after that, the config is not re-exported to the config/sync directory.

    4. Later on, config is imported - this would re-introduce the 'skip_cache' key that was removed in the update.

    #2628144: Ensure that ConfigImport is taking place against the same code base β†’ would prevent step #4, but doesn't help sites that have already got into this state.

  • πŸ‡³πŸ‡ΏNew Zealand quietone

    Fixes are made on on 11.x (our main development branch) first, and are then back ported as needed according to our policies.

  • πŸ‡ΊπŸ‡ΈUnited States attheshow

    Same issue here on 10.3.6. I was able to fix it on my site by editing views.settings.yml and removing the line that said skip_cache: false and then re-running the configuration import.

  • πŸ‡·πŸ‡ΈSerbia super_romeo Belgrade

    #8 worked for me. D10.4

  • πŸ‡¨πŸ‡¦Canada francismak

    Same here, upgraded to 10.3. I think the removal of the skip_cache key was introduced since 10.2 in web/core/modules/views/views.post_update.php, function views_post_update_remove_skip_cache_setting.

    Ref: https://git.drupalcode.org/project/drupal/-/commit/3f6c5710fc9d044bc34de...

    I tried to simulate the case, but after skip_cache is cleared, there is nothing for config to export. Maybe that's why the config still exist in the system.
    Of course, #8 resolve the issue.

    1. Running drush, see the config
    dev-www>drush config:get views.settings skip_cache
    'views.settings:skip_cache': false

    2. Running the code copied from views_post_update_remove_skip_cache_setting manually:
    \Drupal::configFactory()
    ->getEditable('views.settings')
    ->clear('skip_cache')
    ->save(TRUE);

    3. Clear cache and verify
    dev-www>drush cr
    [success] Cache rebuild complete.
    dev-www>drush config:get views.settings skip_cache
    'views.settings:skip_cache': null

    4. Drush export
    dev-www>drush cex
    [notice] The active configuration is identical to the configuration in the export directory (../config/sync).
    ../config/sync

Production build 0.71.5 2024