Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
part of #2011290: [meta] standards cleanup to get ready for getting into core
Clean up the following file:
http://drupalcode.org/project/config_translation.git/blob/HEAD:/lib/Drup...
Proposed resolution
Remaining tasks
User interface changes
No
API changes
No
Comment | File | Size | Author |
---|---|---|---|
#32 | config_translation.code_manageform.2017985-31.patch | 10.63 KB | YesCT |
#32 | interdiff-29-31.txt | 1.16 KB | YesCT |
#29 | config_translation.code_manageform.2017985-29.patch | 10.61 KB | YesCT |
#29 | interdiff-27-29.txt | 940 bytes | YesCT |
#27 | config_translation.code_manageform.2017985-27.patch | 10.62 KB | YesCT |
Comments
Comment #1
YesCT CreditAttribution: YesCT commentedForm-generating functions
in https://drupal.org/node/1354#functions
use a special one line summary format different than the usual method third person verb..
these are methods that build forms. I'm not sure how those should be.
buildConfigForm needs types on these in the doc block and type hinting on the method
Also, I think the base_key string is not NULL but '' which is the empty string and just a string still.
schema might be a string, but I think the config object is a .. class.
Oh, maybe it's \Drupal\Core\Config\Config
reordered the use's
added some "the"s to help the comments.
fixed format of {@inheritdoc} (no period on those lines and needs the curly brackets
Next: still need to actually read through this one. Stopped part way done.
Comment #2
YesCT CreditAttribution: YesCT commentedComment #3
YesCT CreditAttribution: YesCT commentedComment #4
YesCT CreditAttribution: YesCT commentedis base_config the config in the source language?
it's sometimes typed as array and sometimes \Drupal\Core\Config\Config
I wonder if we should just call it source_config, or does base imply something a bit more?
----
array_filter takes out either the base key, or the key, if they are null/empty? and then the implode concatenates them to make the key or just that part of the config?
I think this line could use a comment, but I dont know what it should be.
Maybe this would make more sense if $base_key was described better?
will the name in base_config ever be NULL or '' or '0'?
If a name could be '0' it will get filtered out, and that might lead to duplicates.
I'm hoping no one names their keys '0'
I'll make a guess at a comment for it:
I'm probably over thinking this.
----
Next read through setConfig.
Comment #5
YesCT CreditAttribution: YesCT commentedhttps://drupal.org/node/2016569, change notice for locale_storage().
#2020343: remove instance of locale_storage() is doing that.
Comment #6
YesCT CreditAttribution: YesCT commentedTook out a commented dpm
Put full namespaced paths in the @param
Tried to clarify some comments.
Next: review by someone.
Comment #7
Gábor HojtsyPatch does not apply anymore.
patching file lib/Drupal/config_translation/Form/ConfigTranslationManageForm.php
Hunk #2 FAILED at 7.
Hunk #3 succeeded at 64 with fuzz 1 (offset 17 lines).
Hunk #4 succeeded at 104 (offset 17 lines).
Hunk #5 succeeded at 119 with fuzz 1 (offset 17 lines).
Hunk #6 succeeded at 145 (offset 17 lines).
Hunk #7 succeeded at 161 (offset 17 lines).
Hunk #8 succeeded at 225 (offset 17 lines).
Hunk #9 succeeded at 246 (offset 17 lines).
Hunk #10 succeeded at 269 (offset 17 lines).
Hunk #11 succeeded at 299 (offset 17 lines).
Hunk #12 succeeded at 310 (offset 17 lines).
1 out of 12 hunks FAILED -- saving rejects to file lib/Drupal/config_translation/Form/ConfigTranslationManageForm.php.rej
Unrelated to the scope of this patch but important:
This todo should now be possible in the module, no core changes required. Should be a different issue :)
Comment #8
robertdbailey CreditAttribution: robertdbailey commentedrerolled patch
Comment #10
Gábor HojtsyWrong patch? Seems like one committed earlier.
Comment #11
robertdbailey CreditAttribution: robertdbailey commenteduploaded the correct reroll
Comment #13
YesCT CreditAttribution: YesCT commentedthe exceptions are probably from the typecasting.
Maybe types are being used, different then the documentation.
[edit]
yeah, for example:
Comment #14
robertdbailey CreditAttribution: robertdbailey commentedper discussion on #drupal-i18n, parameters 2 and 3 being passed to buildConfigForm were used by the function as arrays, rather than Config objects. Also, the variable $base_config was being used both as an array and as a Config object in this file.
So, I've updated the function signature of buildConfigForm to accept arrays instead, and I've modified all references to $base_config that were supposed to be arrays to be "$base_config_data"; and I've modified all references to $config that were supposed to be arrays to be "$config_data" as well. The variable assigned to a Config object was left as "$base_config".
Comment #15
YesCT CreditAttribution: YesCT commentedI thought one could stay $base_config and be the Config type.
Comment #16
Gábor HojtsyI think this looks all good changes. Only one thing:
We can/should typehint the array in the signature too?
Comment #17
YesCT CreditAttribution: YesCT commentedah, I see this one was not in the patch. ok.
Comment #18
robertdbailey CreditAttribution: robertdbailey commentedadded typehinting for the two arrays in the buildConfigForm signature in lib/Drupal/config_translation/Form/ConfigTranslationManageForm.php
Comment #20
Gábor Hojtsy#18: config_translation.code_manageform.2017985-18.patch queued for re-testing.
Comment #22
YesCT CreditAttribution: YesCT commentedthis conflicted with #2028127: clean up property names to be camel case instead of underscore separated words to cleanup to get ready for getting into core
just a reroll (followed https://drupal.org/patch/reroll instructions)
Comment #23
YesCT CreditAttribution: YesCT commentedComment #25
YesCT CreditAttribution: YesCT commentedaddresses the second part of #7
Next steps: still need to get the type hints right.
Comment #27
YesCT CreditAttribution: YesCT commentedFails are:
So, looks like this is recursively called, and finally, the config_data and base_config_data are strings.
I'm not totally sure I understand, but... here goes.
Comment #29
YesCT CreditAttribution: YesCT commentedoh. :) silly me. I confused docs with uh.. code.
Comment #30
vijaycs85correct me, if I'm wrong. 'Provides a manage configuration translation form' doesn't sound right. May be 'Provides a form to manage configuration translation' or 'Provides a configuration translation manage form'?
config => configuration
Comment #31
YesCT CreditAttribution: YesCT commentedfixing this now.
Not sure about changing config to configuration everywhere...
variables and classes.. and the module use "config".
Comment #32
YesCT CreditAttribution: YesCT commentedlet's think about changing config -> configuration in all our docs and do that in a separate issue.
I asked on irc and Xano thought it would be a good idea.
Comment #33
vijaycs85Committed f8e2c48 and pushed to 8.x-1.x. Thanks!
Comment #34
YesCT CreditAttribution: YesCT commentedre #32
#2038743: docs cleanup use configuration instead of config