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
.
Comment | File | Size | Author |
---|---|---|---|
#56 | 981870-56.patch | 101.66 KB | spokje |
Comments
Comment #1
dawehnerCan you fix the codestyle, please?
Comment #2
infojunkieFixed the code style.
Comment #3
dawehnerIt 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.
Comment #4
infojunkieAdded a comment for both new sections.
Comment #5
merlinofchaos CreditAttribution: merlinofchaos commentedThis 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.
Comment #6
infojunkieHow about adding an option in the argument to skip or include computed values?
Comment #7
merlinofchaos CreditAttribution: merlinofchaos commentedThat'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.
Comment #8
infojunkieRerolled to show option in argument handler.
Comment #11
merlinofchaos CreditAttribution: merlinofchaos commentedDeleted 2 comments posted to wrong issue to prevent later confusion.
Comment #12
merlinofchaos CreditAttribution: merlinofchaos commentedOk, committed.
Comment #14
andypostI 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
Comment #15
andypostComment #16
joelpittetThis 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.
Comment #17
colanWe'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.
Comment #18
colanComment #19
joelpittetRe-uploaded. RTBC get's tested too I believe.
Comment #21
colanThanks!
Comment #22
dawehnerI'm sorry but doesn't this also introduces a BC break?
Comment #23
colanI suppose it's possible that this could break backward compatibility.
From dawehner on IRC:
Thoughts anyone?
Comment #26
catchComment #27
jibranComment #30
sukanya.ramakrishnan CreditAttribution: sukanya.ramakrishnan at Workday, Inc. commentedThis 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!
Comment #31
sukanya.ramakrishnan CreditAttribution: sukanya.ramakrishnan at Workday, Inc. commentedComment #42
nikhil_110 CreditAttribution: nikhil_110 at Material commentedRe-roll patch Attached against Drupal 10.1.x
Comment #44
lendudeDiscussed this with @xjm and @longwave at Drupal Dev Days and we all agree this checkbox should be removed.
Comment #45
lendudeHere we go. Removed the setting. Update hook added to remove from existing and newly imported config. Removed from all existing core config.
Comment #46
lendudeUpdated the IS
Comment #47
smustgrave CreditAttribution: smustgrave at Mobomo commentedApplied 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.
Comment #48
lendudeComment #50
xjmAdding credits for DDD discussion.
Comment #52
lendudeUnrelated fails
Comment #53
longwave#3361121: [random test failure] InstallerExistingConfig[SyncDirectory]MultilingualTest::testConfigSync fixed some config install tests, looks like we need work here for that.
#3376563: Random test fail in Drupal\Tests\Component\Utility\RandomTest::testRandomMachineNamesUniqueness is a genuine random fail in the random component :)
Comment #54
spokjeRemoved
default_argument_skip_url
fromviews.view.files
andviews.view.glossary
frommultilingual.tar.gz
No interdiff, because the only change is that tarball and interdiff on that is useless.
Comment #55
spokjeIt really helps if you supply the correct tarball format _sigh_
Again, no interdiff, since the only change is in a tarball.
Comment #56
spokjeAnd maybe even not include the local test changes in an official patch.
#MustBeMondayMorning
Comment #57
spokjeGoing 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.
Comment #58
lendudeRTBC +1
Comment #60
longwaveTo 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!
Comment #61
xjmI would actually give this a change record.
Comment #62
lendudeAdded small CR, if someone could review we can publish it, https://www.drupal.org/node/3382316
Comment #63
longwaveLooks good to me. Added version numbers and published the change record.
Comment #65
cilefen CreditAttribution: cilefen commentedThere is a regression a reporter thinks may be caused by this issue.
Comment #66
gábor hojtsyVia @berdir:
So it looks like the fallout from this is much bigger than expected.
I am working on #3450284: Support default_argument_skip_url views setting removal checking in Upgrade Status to side-add a deprecation for this in upgrade status at least. But based on that contrib search many more people will run into this.
Comment #67
catchThis is another instance where we missed #3443942: Add proper deprecation notices in config entity presave bc layers.
If we'd done that at the time, then module tests with deprecation reporting enabled would have picked this up since the time it was committed.
We could still retrospectively add the deprecation support to 10.3.0 during beta maybe?
Comment #68
catchOpened #3450868: Add ViewsConfigUpdater deprecation support for default_argument_skip_url.
Comment #69
gábor hojtsyI released https://www.drupal.org/project/upgrade_status/releases/4.3.2 with support for checking for this one specific key deprecation. I don't think we have a generic way to statically detect config keys depreacted but would be happy to add support for that too there for a more general solution.