Add ViewsConfigUpdater deprecation support for default_argument_skip_url

Created on 30 May 2024, over 1 year ago
Updated 27 June 2024, over 1 year ago

Problem/Motivation

πŸ“Œ Skip default argument for view URL does not work and never has so it can be removed Fixed was committed without deprecation support, this means that approximated 1,500 contrib views don't trigger deprecation notices when modules are installed.

We could add deprecation support now to 10.3.x (and 10.4.x), and then modules with deprecation testing on would be warned before they declare 11.x compatibility, as long as they have test coverage.

See [#/3443942] for the general problem. And see πŸ› Label token replacement for views entity reference arguments not working Needs work for an issue that handles things correctly.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Release notes snippet

πŸ“Œ Task
Status

Active

Version

10.4 ✨

Component
ViewsΒ  β†’

Last updated about 2 months ago

Created by

πŸ‡¬πŸ‡§United Kingdom catch

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

Merge Requests

Comments & Activities

  • Issue created by @catch
  • First commit to issue fork.
  • Status changed to Needs review over 1 year ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    Something like this I guess

  • Pipeline finished with Failed
    over 1 year ago
    Total: 286s
    #209723
  • Pipeline finished with Failed
    over 1 year ago
    Total: 377s
    #209722
  • Pipeline finished with Failed
    over 1 year ago
    Total: 185s
    #209746
  • Pipeline finished with Failed
    over 1 year ago
    Total: 548s
    #209762
  • Status changed to Needs work over 1 year ago
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    As the test failures indicate, we missed removing some, or some new instances of Views with default_argument_skip_url got added after wards

  • Pipeline finished with Failed
    over 1 year ago
    Total: 546s
    #210073
  • πŸ‡³πŸ‡±Netherlands Lendude Amsterdam

    I think the remaining failures mean the database fixtures need to be updated? I think?

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

    The update should disable deprecation triggering probably - since we know that views that we update will need the change to be made.

  • πŸ‡³πŸ‡ΏNew Zealand quietone
  • πŸ‡¬πŸ‡§United Kingdom catch

    This update is only in 10.x

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

    quietone β†’ changed the visibility of the branch 3450868-add-viewsconfigupdater-deprecation to hidden.

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

    @catch, sorry about that.

    I went to update the MR and made a mess of it that I was not able to recover from. I made a new MR and hide, and closed, the original.

    I am not sure what #7 means. @catch?

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

    @quietone as far as I know all the 11.x views post updates and associate code handle this correctly, e.g.:

    
    /**
     * Post update configured views for entity reference argument plugin IDs.
     */
    function views_post_update_views_data_argument_plugin_id(?array &$sandbox = NULL): void {
      /** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
      $view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
      $view_config_updater->setDeprecationsEnabled(FALSE);
      \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function (ViewEntityInterface $view) use ($view_config_updater): bool {
        return $view_config_updater->needsEntityArgumentUpdate($view);
      });
    }
    
    /**
     * Clean-up empty remember_roles display settings for views filters.
     */
    function views_post_update_update_remember_role_empty(?array &$sandbox = NULL): void {
      /** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
      $view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
      $view_config_updater->setDeprecationsEnabled(FALSE);
      \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function (ViewEntityInterface $view) use ($view_config_updater): bool {
        return $view_config_updater->needsRememberRolesUpdate($view);
      });
    }
    
    /**
     * Adds a default table CSS class.
     */
    function views_post_update_table_css_class(?array &$sandbox = NULL): void {
      /** @var \Drupal\views\ViewsConfigUpdater $view_config_updater */
      $view_config_updater = \Drupal::classResolver(ViewsConfigUpdater::class);
      $view_config_updater->setDeprecationsEnabled(FALSE);
      \Drupal::classResolver(ConfigEntityUpdater::class)->update($sandbox, 'view', function (ViewEntityInterface $view) use ($view_config_updater): bool {
        return $view_config_updater->needsTableCssClassUpdate($view);
      });
    }
    
    

    $view_config_updater->setDeprecationsEnabled(FALSE); in the post update ensures that no deprecations are triggered by the update path, but deprecation support in ViewsConfigUpdater itself allows them to be triggered by presave hooks.

    πŸ“Œ Add generic interface + base class for upgrade paths that require config changes Active and πŸ“Œ Add generic interface + base class for upgrade paths that require config changes Active have more discussion.

Production build 0.71.5 2024