Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
configuration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
30 Sep 2012 at 08:45 UTC
Updated:
29 Jul 2014 at 21:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
linl commentedHere's the patch
Comment #2
lars toomre commentedSmall coding style nit... Can you move the inline comment from the end of the line you touched to a separate line above. Thanks.
Comment #3
alexpottThese variables are both configuration as if these were configured on your site then you'd probably like to be able to deploy them from development to production. One way of spotting something that is state is something that is rebuilt on a cache clear and/or would not be shared by development and production versions of the same site.
Comment #4
linl commented@alexpott OK, thanks, that makes sense.
Changing title and unassigning myself until I've figured it out.
Comment #5
alexpottFixing tags
Comment #6
linl commentedAnd switching tags back...
Comment #7
albert volkman commentedComment #9
albert volkman commentedComment #10
alexpottThis needs to create a taxonomy.settings.yml file and provide the defaults in this file.
Need a taxonomy_update_N to update variable to config using the function (see system.install).
This is not necessary.
Comment #11
albert volkman commentedAh, I thought that wasn't necessary. Thanks for the review.
Comment #13
anenkov commentedComment #14
anenkov commentedComment #15
penyaskitoThis comment is unnecessary, it smells like a naming problem. Should it be terms_per_page_count?
We should config()->clear() those variables.
Comment #16
anenkov commentedThis is the original comment and the name is almost as the original.
In the above comments is mentioned clearing is not necessary. But I'll include it if it's needed.
Comment #17
anenkov commentedUpdated in regards to above review.
Comment #18
penyaskitoLooks good to me and tests passed. RTBCing.
Comment #19
alexpottThis is unnecessary. Config will be cleared automatically on uninstall
Comment #20
penyaskitoTalked with @alexpott on IRC and he explained me that configs owned by a module are automatically deleted. I have seen some other modules with clear() on them, but was because they were altering other modules configs. So the clears are unnecessary.
Comment #21
penyaskitoNew patch without the config()->clear().
Comment #23
penyaskitoOops, bad patch
Comment #24
penyaskitoForgot config file :-S
Comment #25
penyaskitoGo bot.
Comment #26
alexpottLooks good thanks for the work!
Comment #27
znerol commentedMerge patch from #1831450: Convert taxonomy_maintain_index_table variables to use configuration system into #24.
Comment #28
penyaskitoLGTM if tests pass. I'll leave it as Needs review so alexpott can agree too.
Comment #29
alexpottShould have noticed this before... All config values are strings or arrays at the moment so the yml file values should have single quotes around them and true / false should be '1' / '0'. Sorry.
This might change in the future and there is an issue for that :)
Comment #30
alexpottDuplicated comment :(
Comment #31
alexpottDuplicated comment :(
Comment #32
alexpottDuplicated comment :(
Comment #33
penyaskitoAnd why are tests green? This scares me.
Comment #34
alexpottThis is because our yml reader supports typed variables and the yml file and these variables are never written. In PHP '0' will be treated as false unless you use the === operator.
Comment #35
penyaskitoMakes sense, but should that have tests?
I'll update the patch ASAP.
Comment #36
znerol commentedI cannot reproduce this. Datatypes seem to be written and read ok by
Drupal\Core\Config\FileStorage. See attached (manual) test.Comment #37
znerol commentedShould probably have tests for
taxonomy_update_8004. Miro posted an update on http://drupal.org/node/1667896 covering update tests.Comment #38
alexpottZnerol if you'd written the above test using the config objects and it's set method then the results would be different.
Comment #39
znerol commentedOk, but it occures to me that loading typed data works okay with the config object whilst serialization puts everything into strings. I'm I wrong? Could you point me to the relevant issues, probably could contribute something there...
Comment #40
alexpottZnerol - you are correct loading will work.. but writing though the config object will convert everything to strings.
There is an issue to change this. But the issue is with the Form API since this nearly always returns strings. For now we should just make the values in taxonomy.settings.yml strings and be done. If we convert to using typed data this can be changed later.
Comment #41
znerol commentedOk, I'm leaving this for @penyaskito, I don't want to interfere with what he's working on.
Comment #42
znerol commentedTaking that again, still have some sprint-time.
Comment #43
znerol commentedPatch attached. Currently the mapping for taxonomy related variables to config keys is:
The new
terms_per_page_countis IMO a bit misleading.Comment #44
znerol commentedComment #45
znerol commentedComment #46
berdir#43: 1799218-42-taxonomy-variables-to-cmi.patch queued for re-testing.
Comment #47
berdirDo we have a standard for referencing configuration in comments? So far, I've always (= maybe two times? ;)) used taxonomy.settings.override_selector. That's how you set it using settings.php, that makes IMHO more sense but doesn't necessarly tell you what the config filename/setting name is.
This one is actually yet another differrent way that doesn't mention the config filename at all....
Comment #48
znerol commentedThanks for pointing those out. Before rerolling I'd like to have feedback on another question: In D7 we had
taxonomy_terms_per_page_adminindicating, that this limit is effective only on the admin-page. Now this variable is mapped toterms_per_page_countwhich is somewhat misleading.Comment #49
ACF commentedhave re-rolled with with a return to terms_per_page_admin
Comment #51
ACF commentedsilly mistake.
Comment #52
penyaskitoShould we quote configuration variables in comment or not? I don't know if there is a convention for this, but looks inconsistent.
Newline char missing in the configuration files.
Comment #53
ACF commentedre-rolled without the new lines. Completely agree that there should be a convention for how we quote configuration variables, I've changed the second example so that it's easier to use, but it would be great to have more thoughts on this.
Comment #55
berdirUnrelated test failure due to a database deadlock...
Comment #56
berdir#53: 1799218-taxonomy_variables_to_config-drupal8-53.patch queued for re-testing.
Comment #57
alexpottChange
taxonomy.settings.override_selectortotaxonomy.settings:override_selectorThis line is longer than 80 chars and I would write
you should set taxonomy.settings:maintain_index_table to '0'Whilst this not a written standard it has been followed in several place eg user.install:537, SystemUpgradePathTest.php:68 and a few other places.
Comment #58
ACF commentedfixed the comments.
Comment #59
berdirTwo tiny coding style issues, then this is IMHO ready.
Now the comment is too long :)
Let's move the comment to a separate line while we're changing this line anyway.
Comment #60
ACF commentedHey have changed the first comments to be the correct length. But the trailing comment comes in a a block of a few,
so I've opened up a new issue to deal with coding standards in that file. #1862390: Fix trailing comments from taxonomy.admin.inc..
Comment #61
berdirThe usual practice is to simply fix up lines that you are touched anyway in a patch but a follow-up is fine with me :) This looks good to go.
Comment #63
ACF commented#60: 1799218-taxonomy_variables_to_config-drupal8-60.patch queued for re-testing.
Comment #64
berdirI guess that was a random failure, still RTBC unless it fails again.
Comment #65
berdirComment #66
catchCommitted/pushed to 8.x, thanks!