Remove default_argument_skip_url from views

Created on 17 January 2025, 3 months ago

This old parameter breaks functional tests of modules which depends from Voting Api (for example "Rate")

🐛 Bug report
Status

Active

Version

4.0

Component

Code

Created by

ivnish Kazakhstan

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

Merge Requests

Comments & Activities

  • Issue created by @ivnish
  • Pipeline finished with Success
    3 months ago
    Total: 157s
    #398874
  • 🇺🇸United States tr Cascadia

    Is there a change record for core where this configuration parameter was removed from core?
    It's important to know which version of core it was removed in, and to see whether this is was a rename or a removal, and whether there is an alternative setting recommended.
    Also, just removing it from the Voting API config is not sufficient - that will only affect new installs of the Voting API module, but it won't correct any existing installs.

  • 🇺🇸United States tr Cascadia

    I found the core change record:
    The Views setting default_argument_skip_url has been removed
    This was done in core 10.2, and update functions in the Views module took care of removing that setting from any installed views, at the time. But that update function has since been removed from core in Drupal 11, so any D11 site that installed Voting API still has that configuration setting.

    Since there is still no 3.0.x release, and since the 8.x-1.x release didn't support D11, it's acceptable to make this change without an update function.

    But as per the issue that removed the Views update hooks, 📌 Remove redudundat hook_ENTITY_TYPE_presave() and ViewsConfigUpdater methods Active , Views that are shipped as part of a contributed module (like this one) should be re-exported in order to update the order of the settings so that the configurations can be validated properly. So I've done that and added those additional changes to the MR. I checked this new views config with the Configuration Inspector module and verified that there are no validation errors.

  • 🇺🇸United States tr Cascadia

    I'm bothered by the fact that this didn't show up in the tests for Voting API, but did show up in the tests for Rate.

    We really need a test case added here that will detect this deprectated and removed settings value. I assume some simple test that loads the view should show this error. It's important because Views changes settings like this all the time, and the only way we have to know about that and fix our views configuration is to have a test that fails when Views gets changed.

    I assume we can almost copy a test from Rate and that would do it.

  • 🇺🇸United States tr Cascadia

    OK, that worked!
    What I did was simply to enable the Views module in one of the tests (VoteTest).
    Our view configuration, stored in config/optional/views.view.votingapi_votes, only gets loaded/checked in the tests if the Views module is enabled.
    Since Views was never enabled in our tests, the configuration was never loaded, so the configuration was never checked for errors in our tests.

    You can see that the "test only" test in the pipeline FAILS. This "test only" test only runs the changed test case, without any of the other changes. So as you can see this failure shows our shipped views configuration had a lot of errors, not only this removed setting.

    You can also see that the phpunit tests PASSES, since these include not only the new test but also all the fixes to the configuration file.

    I want to do one more thing - instead of hacking VoteTest to enable Views we should have a new test dedicated to testing that View.

  • ivnish Kazakhstan

    Thanks for investigating! :)

  • ivnish Kazakhstan

    I tested this patch on local and "Rate" tests passed

  • Pipeline finished with Skipped
    3 months ago
    #401322
    • tr committed 47a25722 on 4.0.x authored by ivnish
      Issue #3500528 by tr, ivnish: Remove default_argument_skip_url from...
  • 🇺🇸United States tr Cascadia

    Thanks.

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

Production build 0.71.5 2024