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.
patch forthcoming
Comment | File | Size | Author |
---|---|---|---|
#22 | 353883-follow-up.patch | 612 bytes | Damien Tournoud |
#13 | 353883-locales-inc-dbtng.patch | 29.63 KB | Damien Tournoud |
#11 | 353883-locales-inc-dbtng.patch | 29.85 KB | Damien Tournoud |
#9 | 353883-locales-inc-dbtng.patch | 29.85 KB | Damien Tournoud |
#5 | locale-inc-dbtng.patch | 24.86 KB | killes@www.drop.org |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedWe will need a test for the equivalent of #353886: Too many arguments.
Comment #2
Damien Tournoud CreditAttribution: Damien Tournoud commentedHere is an extension of the .po import test to cover the bug uncovered in #353886: Too many arguments.
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedAnd the correct patch.
Comment #4
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedSee patch. The patch passes all tests, including the new one by Damien.
Fixes also a bug that will be fixed in D6 as #353886.
Comment #5
killes@www.drop.org CreditAttribution: killes@www.drop.org commentedUpdated patch to include two omissions pointed out by Damien.
Comment #6
Crell CreditAttribution: Crell commentedVisual review of #5:
- The first db_update() should have its fields array split across multiple lines.
That snippet introduces a logic change, by moving the query that uses $form_state['values']['domain'] before the check to see if that value exists. I do not know this part of the code base well enough to say if that is a problem or not. That snippet appears twice, in fact, the second one for langcode.
The array lines should only be indented 2 spaces from the ->fields line, not all the way to 2 spaces after the array( keyword.
That whole block can now be condensed into:
Excessive indentation again. There are a couple of others, too, that I'll skip over for now.
That definitely needs to broken out to multiple lines.
Let's leave the query string itself broken across multiple lines. It's FAR easier to read that way.
Comment #7
webchickComment #8
Dave ReidComment #9
Damien Tournoud CreditAttribution: Damien Tournoud commentedHere we are. This depends on #343999: No obvious way to do "IS (NOT) NULL" in a built query?.
Comment #11
Damien Tournoud CreditAttribution: Damien Tournoud commentedNow that the dependent patch is in, let's retry.
Comment #12
csevb10 CreditAttribution: csevb10 commentedThere are a few spots where things should be broken up onto separate lines. The basic rule is that if a query has more than 1 replacement, it should be broken up onto multiple lines. If it's in a conditional statement, it should be moved outside the conditional for clarity. This occurs in at least a few spots.
You should also be able to simplify the following because db_insert should return the lid value (saving you a query in this case)
Those are the issues that jump out at me on first glance. I'll try and take a deeper look if time permits.
Comment #13
Damien Tournoud CreditAttribution: Damien Tournoud commentedThere is no such code style rule. On the contrary, we always put all parameters in the same line.
Good catch. I have no idea why it was so crappy in D6 ;)
Here is a reroll of the patch.
Comment #14
Crell CreditAttribution: Crell commentedOn the contrary, we have been breaking the associative array out into multiple lines, the same as most associative arrays. We're doing that all over core at this point, and it's much easier to read than a 200 character long line. :-)
Comment #15
Damien Tournoud CreditAttribution: Damien Tournoud commentedSince when? Where is this documented?
Comment #16
catchhttp://groups.drupal.org/node/17906 - not really documentation but afaik that's the best we've got.
Comment #17
Damien Tournoud CreditAttribution: Damien Tournoud commentedNo query has more than 2 replacements. I believe this is perfectly correct formatting.
Comment #18
catchLooks fine to me as well.
Comment #19
csevb10 CreditAttribution: csevb10 commentedI'm fine with whatever standard we want to set as long as it is a standard. Right now, it looks like we're being heavily inconsistent with these patches for core. Here we're doing multiple replacements inline, in the book module, we're breaking out single replacements, and in comment module we're breaking out multiple replacements into multiple lines. We can move this discussion for sure, but we should define and follow a standard moving forward so we all know what we should do and it doesn't devolve into a battle of wills.
Comment #20
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks!
Comment #21
catchcsevb10 - agreed, that groups discussion has gone a bit dead, should probably revive it.
Comment #22
Damien Tournoud CreditAttribution: Damien Tournoud commentedOups. One call to
fields()
was namedfield()
, and the test bot was unable to catch that, because it still can't properly catch fatal errors in the parent side (I think we have an issue for that, but I can't find it anymore).Comment #23
cwgordon7 CreditAttribution: cwgordon7 commentedLooks good, nice catch!
Comment #24
pwolanin CreditAttribution: pwolanin commentedthis is breaking any attempt to run tests...
Comment #25
webchickThanks, committed!