So ideally I would have liked to get hook_path_alter() in before an URL alias is saved, but really the only thing that's blocking the D7 versions of both Pathauto and Redirect modules is that we need to know somehow about the original alias values when updating an alias (so if the alias changed, we can redirect from the soon-defunct alias). This works similar to our current comment/node/file/user saving in that they load in $entity->original before saving and invoking the insert or update hooks.
Comment | File | Size | Author |
---|---|---|---|
#30 | path_save-998256-d7-30.patch | 4.19 KB | Albert Volkman |
#25 | path_save-998256-d7-25.patch | 4.19 KB | Albert Volkman |
#22 | 998256-path-save.patch | 4.27 KB | justafish |
#16 | 998256-path-save-combined.patch | 4.27 KB | no_commit_credit |
#15 | 998256-path-save-original-test.patch | 2.93 KB | justafish |
Comments
Comment #1
Dave ReidComment #3
Dave ReidI don't believe you test bot.
Comment #4
Dave Reid#1: 998256-path-save-original.patch queued for re-testing.
Comment #5
Dave ReidComment #6
SilviuChingaru CreditAttribution: SilviuChingaru commentedComment #7
xjmThis would need to go into D8 first, no? Rerolling this for D8 would probably be a good novice task.
Also, could we get an automated test that tries to check for this?
Comment #8
justafishrerolled for D8 and test added
Comment #9
xjmjustafish -- Thanks! Want to upload the test in its own pach as well, to demonstrate its failure on the testbot without the fix?
Comment #10
xjmOh, one other thing. The tests look great (insofar as I can review on my phone), but the API docs are not quite standard. See http://drupal.org/node/1354 for reference. For example, the summaries for classes, functions, and methods should be one line, 80 chars or less, that begins with a verb. Also, it's a but weird to call the one a unit test when it's a web test case. Can we use DrupalUnitTestCase? If not let's change the summary a bit.
I'll also take a look in Dreditor after breakfast.
Thanks!
Comment #11
xjmAlright, so here are specific points for cleanup:
These should begin with third-person verbs.
Bits of trailing whitespace here.
There should be a period at the end of this comment. Also, minor grammar thing, but "language-neutral" should be hyphenated.
Let's get a single newline at the end of these two files.
Comment #12
xjmOh, and these two need to end in periods.
Sorry for all the noise!
Comment #13
justafishHi xjm, Thanks very much for the review! Hopefully I've fixed it all up..
Attached is the original patch rerolled for D8, the test to show it failing and the patch/test combined.
Comment #14
xjmThanks @justafish! Looks like you got most of it. Thanks also for uploading the test-only patch to expose the failures on testbot.
The only remaining things are found are all really minor code style/grammar things:
This probably needs to be:
I think we can probably omit this comment (I looked a bit and didn't seen any precedent for adding a comment like this with other tests.)
I think this needs to read:
This file is still missing its terminal newline.
This should probably be:
Correct?
There should be a period at the end of this summary.
Comment #15
justafishmenu.test L113 and file.test L239 have comments pertaining to enabling dummy modules in their setUp functions. I actually found this very useful from menu.test when working out how to do this so I'm going to leave it in.
"Dummy module implementing hook path." is the exact same comment at the top of menu_test.module, but I've changed it to something more useful for future anyway.
New patches attached rerolled against head.
Comment #16
no_commit_credit CreditAttribution: no_commit_credit commentedAttached adds a grammar fix to an inline comment:
Comment #17
xjmThanks @justafish!
I guess having a comment for the
setUp()
method is not consistent with most test cases that enable test-only modules, but if you think it's helpful, it doesn't hurt anything. :) I'll restrain my compulsion that we should put those inline comments in every othersetUp()
function if we do here. :P The comment at does at least need to behook_path_update()
with parens and have an article, like:(Fixed in the patch above. Since these are just documentation cleanups it's okay to upload just a single patch for the subsequent rerolls, as we have the exposed failure in #13 to demonstrate the test for reviewers.)
I like the new file docblock; that is clearer as well.
Thanks for all your work on this. I think it's RTBC now.
Comment #18
justafish#15: 998256-path-save-original-test.patch queued for re-testing.
Comment #19
justafish#15: 998256-path-save-original.patch queued for re-testing.
Comment #20
justafish#15: 998256-path-save-combined.patch queued for re-testing.
Comment #22
justafishaccounting for altered language key
Comment #23
Dave ReidHooray! Excellent job justafish on the tests and passes.
Comment #24
catchLooks good. Committed/pushed to 8.x, moving back to 7.x.
Comment #25
Albert Volkman CreditAttribution: Albert Volkman commentedD7 backport.
Comment #26
xjmBackport is fine too.
Comment #27
Dave ReidYep looks good here too.
Comment #28
webflo CreditAttribution: webflo commentedShould be core 7.x. Right?
Comment #29
xjmHmmm how did that one slip through? Why would that pass testbot?
Comment #30
Albert Volkman CreditAttribution: Albert Volkman commentedYeah, definitely odd that that didn't get caught. Thanks @webflo!
Comment #31
xjmI'm concerned about the testbot thing; it implies the test coverage is incomplete. We should try to debug why it didn't fail and either amend the test or open a followup issue, I think.
Comment #32
xjmAlright, sun and chx clarified #31 on IRC. The core version compatibility isn't checked when simpletest enables a module, so it was being enabled properly in the test despite the .info file.
Comment #33
Albert Volkman CreditAttribution: Albert Volkman commentedThanks @xjm!
simpletest_knowledge++
Comment #34
webchickCommitted and pushed to 7.x. Thanks!