Closed (fixed)
Project:
Drupal core
Version:
8.0.x-dev
Component:
locale.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
19 Jun 2014 at 00:59 UTC
Updated:
5 Nov 2014 at 10:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
yesct commentedapply the patch 69 from #1533250: Many coding standards clean-ups in locale module first.
(this wont apply)
Comment #3
yesct commentedthis will surely conflict with the other make locale pass coder issue, but does not really need to wait on that.
this is not a thoughtful patch, just want to see what fails.
Comment #5
yesct commentedtl;dr it's an object not an array. fixed the comment and the function definition.
-------------
error was
71 is
relevant before that:
project info is part of project which is part of status, status is from
$status = locale_translation_get_status();result is an array of things... but it doesn't document it...
there
$result[$project][$langcode] = $sources[$project][$langcode];...
$sources = locale_translation_build_sources(array($project), array($langcode));which says
so... I guess object...
Comment #6
yesct commentedOh, good. it passes.
----------
1.
needs work to add descriptions for these.
2.
also to carefully check the changes.
3.
especially to see if maybe we can say if any of these arrays are arrays of objects (particular classes).
Comment #7
yesct commented1. copied the docs from locale_translation_batch_fetch_finished since those parameters are passed through there.
2. fixed an accidental extra space in an updated comment.
3. I looked through all the changes and I dont think we can type hint any of the arrays more specifically.
===
this needs a real review.
Comment #8
les limPatch no longer applies. Tagging for reroll.
Comment #9
les limHere's the straight reroll. More detailed review to follow.
Comment #10
fran seva commentedRerolling #9 patch.
Comment #11
xlin commentedUnder the help of mentor, we found few things need to be change.
In function locale_translation_batch_status_check(), the options array was optional but make un-optional. This change is not in the scope of the issue. Why it was needed to be made?
#10 patch add a blank before the @param bool $force in locale_translate_batch_import_files() , this is not standard. See doxygen reference: https://www.drupal.org/node/1354#order
[edit: to correct link]
Comment #12
yesct commentedoops. adding (optional) made these lines go over 80 chars. Let's fix that.
----
also needs a review for the rest of the patch.
Comment #13
xlin commentedPlease review.
Comment #14
yesct commentedstill applies and looks good to me. but I worked on this, so probably needs someone else to review.
Comment #15
fabianx commentedLooks great to me!
Comment #16
yesct commentedComment #17
alexpottSo this actually can not be optional since $context is mandatory and after it in the argument list. So let's remove the optional altogether. Plus $context can also be typehinted with
array(as it is elsewhere in this patch)Comment #18
yesct commentedso should the $options = array() be taken out also... if it is not optional?
Comment #19
yesct commentedhm. maybe like this?
Comment #21
yesct commentedoops. named the interdiff wrong in my last comment, anyway...
read the whole thing and noticed this nit about line wrapping.
Comment #22
jhodgdonUm...
That last line seems ... extraneous, because the elements each say they're optional, and I also don't think we need to tell people that "an empty array" is "for example: array()". If you think it's that important to include, then I think it should be worked into the first line of the param docs, not slapped onto the end where it's less likely to be noticed?
Also I'm concerned about:
This used to have a default value of array() but now it doesn't?
Also we have a standard that if a parameter is optional, the first line of the description should say "(optional)".
And here:
This is missing the word "are"... if no files [ARE] used to...
The rest looks good...
Comment #23
yesct commentedyeah, the removal of the default (and moving it to the awkward line in the docs is because of @alexpott 's comment #17.
So it is essentially making it not optional. We didn't have any uses in core of it being optional (not specified).
Reordering the arguments .. is a bit more than just typehinting so sounds like a separate issue to me.
Yeah, the are thing makes sense.
Comment #24
jamesdixon commentedI am on this.
Comment #25
jamesdixon commentedHere's my attempt at updating the documentation based on the feedback provided. I added (optional) in front of finish_feedback and use_remote instead of having them at the end.
I've removed the last line saying options can be an empty array.
Comment #26
jamesdixon commentedComment #27
jamesdixon commentedI'm going to take a couple things out of the patch and create a new issue for some of it as recommended by YesCT.
Comment #28
jamesdixon commentedComment #29
jhodgdonSo... this issue is not really just documentation? perhaps change the component?
Comment #30
jamesdixon commentedI've created a new issue for rearranging the order of the arguments in locale_translation_batch_status_check:
https://www.drupal.org/node/2359615
Comment #31
jamesdixon commentedHere's the proposed patch. I've removed the documentation updates from locale_translation_batch_status_check as it needs some work in the issue that was just created regarding the argument reordering.
Comment #32
alexpottSorry but I've just closed #2359615: function locale_translation_batch_status_check has an optional argument before a mandatory argument in the function definition and explained on that issue why reordering the arguments is not possible and why the
$optionsargument can not possible be optional.Comment #33
jamesdixon commented@alexpott: I apologize I misunderstood when creating that issue. I'll just change the component from documentation to locale.module and make the options argument no longer optional.
Comment #34
jamesdixon commentedI've updated the options argument in locale_translation_batch_status_check so it is no longer optional and changed the documentation to reflect this. Here's the next patch.
Comment #35
alexpottLooks great to me. Thanks for sticking with it @jamesdixon.
The $options argument is itself not actually optional because of how the batch system works. Both the elements it can contain are optional and that fact is documented.
Comment #36
catchCommitted/pushed to 8.0.x, thanks!