Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
views.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
26 Nov 2015 at 11:18 UTC
Updated:
24 Jan 2017 at 12:24 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
tstoecklerComment #3
sagar ramgade commentedPatch attached fixes the proposed solution.
Comment #4
dawehnerIMHO those expose any kind of configuration so why can't we just drop those entries entirely?
Comment #5
tstoecklerRe @dawehner, I was thinking the same, but if we don't declare e.g.
views.argument_default.nodethenTypedConfigManagerwill fall back toundefinedfor the respectivedefault_argument_optionskey in the config which will then fail config schema validation.Not sure if we want to tackle the missing schema of
views.argument_default.query_parameterhere as well, or if we want a separate issue for that.Comment #6
dawehnerAccording to our discussion I think we should have
views.argument_default.*and then remove the other pointless ones.Comment #7
dawehnerComment #8
snehi commentedComment #9
snehi commentedComment #10
anil280988 commentedHi tstoeckler/dawehner,
Could you suggest if "argument_default" in other modules also needed to be corrected.
Comment #11
dawehnerNo these are the only ones needed in Drupal core.
Comment #12
anil280988 commentedReuploading the patch, though already created by Sagar Ramgade.
Comment #13
dawehner@see https://www.drupal.org/node/2623568#comment-10612250 for my previous feedback.
Comment #14
himanshugautam commentednew patch considering comment 10612250
Comment #15
himanshugautam commentedComment #17
himanshugautam commentedComment #18
vg3095 commentedComment #20
sidharthapUpdated patch.
Comment #21
dawehner#6 is still not addressed :(
Comment #22
dbjpanda commentedComment #23
sidharthapThank you @dawehner for reviewing it. is #6 says about to remove all instance of views.argument_default.* from user.views.schema.yml ?
Comment #24
dawehnerNo, its about adding a
views.argument_default.*entryComment #25
tstoecklerComment #26
tstoeckler@dbjpanda: Oops missed that this was assigned before tagging it for the sprint on the weekend, sorry. Are you still working on this?
Comment #27
dbjpanda commentedComment #28
tstoecklerThanks @dbjpana! Hopefully we will find someone on the weekend to work on this so we can finally get this done.
Comment #30
yanniboi commentedOk, so I'm not sure if this is right, but I have added views.argument_default.* and removed views.argument_default.node and views.argument_default.current_user.
Have I missed anything?
Comment #31
yanniboi commentedI added a test. Not sure if there is a better way to test, I'm open to suggestions.
Comment #32
yanniboi commentedAhh that was a bad test_no_fix patch... Ignore that one for this one.
Comment #34
yanniboi commentedComment #38
yanniboi commentedMan apologies all round, I am doing badly with my patches today :/
Comment #40
claudiu.cristeaVoilà!
Comment #41
dawehnerThis looks quite nice ... do you think some kind of test would be though helpful here?
Comment #42
claudiu.cristeaDid we tested other default arguments? Have no idea.
Comment #43
dawehnerSure, we have
\Drupal\user\Tests\Views\ArgumentDefaultTestfor example.Comment #44
dawehnerIt is always good to add some form of tests :)
Comment #45
claudiu.cristeaAdded test for query parameter. The others are tested.
Comment #46
dawehnerThanks a lot @claudiu.cristea. I know writing tests can be painful sometimes, but its worth on the longrun.
Comment #47
xjmLooks like this would need an upgrade path, no?
Comment #48
claudiu.cristea@xjm, we are not changing any configuration object (view) here we're only providing schema (data definition) for existing views config objects. Nothing will change in the way they are structured. New configs/views will have the same structure as the existing ones.
I'm setting this back to RTBC for the above reasons but if you feel I'm wrong, feel free to set it back to NW.
Comment #49
xjmHmm but if it doesn't need an upgrade path then how come our existing schema tests didn't catch this? Or if the schema is wrong, then how can all config saved with the wrong schema be right?
It is totally possible I am confused about something, though, so leaving at RTBC and assigning to alexpott.
Comment #50
dawehnerWe had no single instance of code using that plugin, so there was nothing to be validated. We added a test here.
Comment #51
alexpottYep there's no upgrade path necessary here because the change should result in no config changes. If the new schema was enforcing a data type other than string then an upgrade path would be necessary.
Comment #52
alexpottThese two cases are not tested. In the test view - which appears to be testing a node type argument.
Also please make test only patches.
Comment #53
claudiu.cristeaCorrect me if I'm wrong:
views.argument_default.nodeis tested in \Drupal\views\Tests\Plugin\ArgumentDefaultTest::testArgumentDefaultNode()views.argument_default.current_useris tested in \Drupal\user\Tests\Views\ArgumentDefaultTest::test_plugin_argument_default_current_user()Improved the test to check also the fallback. Added "test only" patch.
Comment #55
claudiu.cristeaThe test-only failed. The patch passed.
Comment #56
dawehnercore/modules/views/tests/modules/views_test_config/test_views/views.view.test_argument_default_node.ymlusesand
core/modules/user/tests/modules/user_test_views/test_views/views.view.test_plugin_argument_default_current_user.ymluses no default_argument_options at all, which is why this schema was never triggered.Comment #57
xjmComment #59
dawehnerI hope #2623568-56: Config schema of argument_default plugins is incorrect explains why the test coverage is good enough. We cannot enlarge the test coverage, unless we basically want to retest schema validation as a concept.
Comment #60
alexpottCommitted 4fc22ad and pushed to 8.3.x. Thanks!
Whilst there is no necessary upgrade path for 8.3.x because caches will be cleared we'd need a specific function for 8.2.x so I've not committed this to 8.2.x. If we want to fix this there then we need to ensure a cache flush occurs.
Comment #61
claudiu.cristeaHere's the cache rebuild.
Comment #63
claudiu.cristeaThe patch has been once reviewed,. I don't know if needs a new review for that 8.2.x addition. I'm tentatively RTBC it.
Comment #64
alexpottCommitted 6663917 and pushed to 8.2.x. Thanks!
I've also committed the interdiff to 8.3.x since I'm not too wild about 8.3.x missing an update that is in 8.3.x. Committed 04a771a and pushed to 8.3.x. Thanks!