Problem/Motivation

A setting for default_argument_skip_url was added to D7, but has never worked in D8. We should remove this setting since it has never worked, was only used in edge cases in D7 and the current description and title make it unclear to most users what the purpose of this setting is.

Steps to reproduce

Proposed resolution

Remove the setting.

Remaining tasks

User interface changes

Unclear and broken setting is removed from the UI

API changes

Data model changes

Release notes snippet

Original report

I'm using a View with 2 arguments: one passed on the URL and the second is computed. When I attach a feed to this view, the feed URL contains those 2 arguments. What I really need is that the feed URL only contains the explicit argument, not the computed one.

The patch here modifies view::get_url to only include arguments that were passed on the URL. To detect them, it sets a new attribute in the argument handler called is_default during view::_build_arguments.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

dawehner’s picture

Status: Needs review » Needs work

Can you fix the codestyle, please?


+      if (!empty($this->argument)) foreach ($this->argument as $argument_id => $argument) {
infojunkie’s picture

Status: Needs work » Needs review
FileSize
1.05 KB

Fixed the code style.

dawehner’s picture

It would be cool if some kind of code explains what the flag does etc.

It's hard to understand for someone not understand it totally.

infojunkie’s picture

Added a comment for both new sections.

merlinofchaos’s picture

This is a really tough one. I can see this going either way.

Particularly if the path is something like node/%/foo -- I might have a block that shows somewhere that links to a tab on the node. In that case, I would absolutely want the argument to appear in the more link.

And if I'm using a summary view? I almost certainly absolutely positively DO want that in there.

And in other cases, including one that's currently in the issue queue, I do not want that argument in there.

This needs some serious thought because I don't think there is a way to get this right automatically.

infojunkie’s picture

How about adding an option in the argument to skip or include computed values?

merlinofchaos’s picture

That's probably the only solution. It's a pretty difficult one to get the wording right for, but let's start by trying out a checkbox. It's okay if the checkbox is buried, this is a .5% use case.

infojunkie’s picture

Rerolled to show option in argument handler.

merlinofchaos’s picture

Deleted 2 comments posted to wrong issue to prevent later confusion.

merlinofchaos’s picture

Status: Needs review » Fixed

Ok, committed.

Status: Fixed » Closed (fixed)

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

andypost’s picture

Version: 6.x-3.x-dev » 7.x-3.x-dev
Status: Closed (fixed) » Needs work
FileSize
1.55 KB

I think it's not fixed, is_default does not prevents for arguments that passes from page manager
For example, I wanna pass 1st argument from panel but 2nd from url - for now get_url always appends this 1st argument to action url

Patch removes is_default so devs can manually use 'default_argument_skip_url' checkbox for arguments that should not appear in url

andypost’s picture

Status: Needs work » Needs review
joelpittet’s picture

Issue summary: View changes
Status: Needs review » Reviewed & tested by the community

This does the trick: if that checkbox is or is not checked the arguments get appended to the custom URL without the patch.

With the patch the arguments aren't appended to the end of the custom URL as expected.

colan’s picture

We've recently switched our testing from the old qa.drupal.org to DrupalCI. Because of a bug in the new system, #2623840: Views (D7) patches not being tested, older patches must be re-uploaded. On re-uploading the patch, please set the status to "Needs Review" so that the test bot will add it to its queue.

If all tests pass, change the Status back to "Reviewed & tested by the community". We'll most likely commit the patch immediately without having to go through another round of peer review.

We apologize for the trouble, and appreciate your patience.

colan’s picture

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

Status: Needs work » Reviewed & tested by the community
FileSize
1.55 KB

Re-uploaded. RTBC get's tested too I believe.

  • colan committed 7bd62d1 on 7.x-3.x authored by andypost
    Issue #981870 by infojunkie, joelpittet, andypost: views::get_url() to...
colan’s picture

Project: Views (for Drupal 7) » Drupal core
Version: 7.x-3.x-dev » 8.1.x-dev
Component: Code » views.module
Status: Reviewed & tested by the community » Patch (to be ported)

Thanks!

dawehner’s picture

I'm sorry but doesn't this also introduces a BC break?

colan’s picture

I suppose it's possible that this could break backward compatibility.

From dawehner on IRC:

Changing the way how those URLs are generated IMHO could lead to problems, when people kind of assume some of those.

Thoughts anyone?

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

Drupal 8.1.0-beta1 was released on March 2, 2016, which means new developments and disruptive changes should now 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.2.x-dev » 8.3.x-dev

Drupal 8.2.0-beta1 was released on August 3, 2016, which means new developments and disruptive changes should now 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.

catch’s picture

Status: Patch (to be ported) » Needs work
jibran’s picture

Title: views::get_url() to skip default arguments » ViewExecutable::getUrl() to skip default arguments

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

Drupal 8.3.0-alpha1 will be released the week of January 30, 2017, which means new developments and disruptive changes should now 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.4.x-dev » 8.5.x-dev

Drupal 8.4.0-alpha1 will be released the week of July 31, 2017, which means new developments and disruptive changes should now 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.

sukanya.ramakrishnan’s picture

Title: ViewExecutable::getUrl() to skip default arguments » Skip default argument for view URL does not work!
Status: Needs work » Needs review
FileSize
730 bytes

This issue exists in Drupal 8.0 and above also.

The option 'Skip default argument for view URL' doesnt work at all in 8.0 and above!

sukanya.ramakrishnan’s picture

Status: Needs review » Needs work

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

Drupal 8.5.0-alpha1 will be released the week of January 17, 2018, which means new developments and disruptive changes should now 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.6.x-dev » 8.7.x-dev

Drupal 8.6.0-alpha1 will be released the week of July 16, 2018, which means new developments and disruptive changes should now 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.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.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.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). 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.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now 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.

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

Drupal 9.1.0-alpha1 will be released the week of October 19, 2020, which means new developments and disruptive changes should now be targeted for the 9.2.x-dev branch. For more information see the Drupal 9 minor version schedule and the Allowed changes during the Drupal 9 release cycle.

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.

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.

Nikhil_110’s picture

Re-roll patch Attached against Drupal 10.1.x

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.

Lendude’s picture

Category: Feature request » Task

Discussed this with @xjm and @longwave at Drupal Dev Days and we all agree this checkbox should be removed.

  • It hasn't worked since Drupal 8.0.0
  • the functionality is very edge case
  • the description and title of the field are very unclear as to what a user could expect this to do
Lendude’s picture

Status: Needs work » Needs review
FileSize
46.21 KB

Here we go. Removed the setting. Update hook added to remove from existing and newly imported config. Removed from all existing core config.

Lendude’s picture

Title: Skip default argument for view URL does not work! » Skip default argument for view URL does not work and never has so it can be removed
Issue summary: View changes

Updated the IS

smustgrave’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: +Needs Review Queue Initiative

Applied the patch and searched for default_argument_skip_url.
Found 19 instances that were in the test, update hook, or fixture for the test.
Ran the update hook to make sure that ran and it did without issue.

Think this is good.

Lendude’s picture

Issue tags: +ddd2023

xjm credited longwave.

xjm’s picture

Adding credits for DDD discussion.

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 45: 981870-45.patch, failed testing. View results

Lendude’s picture

Status: Needs work » Reviewed & tested by the community

Unrelated fails

longwave’s picture

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

Removed default_argument_skip_url from views.view.files and views.view.glossary from multilingual.tar.gz

No interdiff, because the only change is that tarball and interdiff on that is useless.

Spokje’s picture

FileSize
102.86 KB

It really helps if you supply the correct tarball format _sigh_

Again, no interdiff, since the only change is in a tarball.

Spokje’s picture

FileSize
101.66 KB

And maybe even not include the local test changes in an official patch.
#MustBeMondayMorning

Spokje’s picture

Status: Needs work » Reviewed & tested by the community

Going to tentatively self back-to-RTBC.

- I didn't change any code.
- The only changes were made in a fixture, which wasn't testable before because of the re-enabling of the test in #3361121: [random test failure] InstallerExistingConfig[SyncDirectory]MultilingualTest::testConfigSync wasn't committed yet.

Lendude’s picture

RTBC +1

  • longwave committed f890b7ff on 11.x
    Issue #981870 by Spokje, Lendude, longwave, xjm, smustgrave: Skip...
longwave’s picture

Status: Reviewed & tested by the community » Fixed

To me this doesn't need a change record given we are just removing something that is entirely broken.

Committed f890b7f and pushed to 11.x. Thanks!

xjm’s picture

I would actually give this a change record.

Lendude’s picture

Added small CR, if someone could review we can publish it, https://www.drupal.org/node/3382316

longwave’s picture

Looks good to me. Added version numbers and published the change record.

Status: Fixed » Closed (fixed)

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

cilefen’s picture

There is a regression a reporter thinks may be caused by this issue.