Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
trigger.module
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Apr 2012 at 16:28 UTC
Updated:
1 Mar 2013 at 03:41 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
btmash commentedLooking through core, these are the following hooks/operations we should try and test on (this is based on a quick search for hook_action_info():
nodeapi(view, insert, update, delete)comment(view, insert, update, delete)user(view, insert, update, delete, login)taxonomy(insert, update, delete)Comment #2
btmash commentedAlright, I'm adding a patch that consists solely of the tests. As an FYI, it fails on taxonomy. So something changed there. I don't know if there are other things I have missed, however. But this seemed like the easiest path to take and if someone could take a read through the tests to see if they make sense, that would be awesome.
Comment #3
btmash commentedAnd here is a patch that should fix the trigger issue. Note: anyone else that is good with str_replace and the like is welcome to change it up. We just have to account for both 6.x and 7.x (so we need to also update the trigger update tests from 7.0 to 7.x)
Comment #4
btmash commentedAck...forgot patch.
Comment #5
btmash commentedAnd bumping this to major since trigger upgrade path for taxonomy triggers is currently broken.
Comment #6
btmash commentedOk, I ended up finding some more hooks, and I fleshed out the update path tests for trigger from 7.0 -> 7.x as well. However, I can't figure out why the cron task does not update. Any help would be greatly appreciated.
Comment #7
btmash commentedFinally figured out that the reasons for the fail were because I misspelled 'system'. Latest patch should pass.
Comment #8
xjmI think this is a bug since the upgrade is destroying data.
At first glance the test coverage looks great. I'd like to see the latest results of the test by themselves exposed on QA, so I'll try to upload a patch for that shortly.
Couple minor notes:
I think "Update path" should be capitalized here.
This is user-facing text, so I'd say something a little clearer. (Also update hooks get imperative verbs for the same reason; see http://drupal.org/node/1354#hookimpl.)
Perhaps "Update taxonomy hooks to new names." Something along those lines?
Leaving at NR since I haven't looked at the tests closely yet.
Comment #9
xjmAttached just cleans up the minor points above and includes the latest tests separately to expose the taxonomy failures.
Comment #10
xjmOh, for the next reroll, the inline comments also need to end in periods. :)
Comment #11
aspilicious commentedTaxonomy vs trigger
Comment #12
xjmNo, actually. This is the trigger module updating the names of the taxonomy hooks in its database records to their Drupal 7 names. So the doc is correct.
Comment #13
catchTagging.
Comment #14
xjmAttached just tweaks the update hook doc slightly to avoid confusion like @aspilicious's in #11.
Comment #15
xjmNot sure what happened to the interdiff upload; one more time.
Comment #16
xjmHrm. I was about to update the doc here to mention cron too, but there is no
hook_cron_run()in D6 or D7, nor can I find this grepping D6. Can you clarify where the value'cron_run'would be coming from?Comment #17
berdirThat's not a Drupal hook, it's a trigger hook, see http://api.drupal.org/api/drupal/modules%21trigger%21trigger.module/func... and http://api.drupal.org/api/drupal/modules%21system%21system.module/functi....
Yes, the hook is defined in system.module but called in trigger.module ;)
Comment #18
btmash commented@xjm, This is actually initiated via
trigger_cron(see http://api.drupal.org/api/drupal/modules!trigger!trigger.module/function... and http://api.drupal.org/api/drupal/modules!trigger!trigger.module/function...).As far as the update hook names...even though it is coming from the trigger module (hence the updates would be groups with trigger updates), it made sense to say what hook names in the db were being updated.
Comment #19
catchDowngrading this.
While some data gets lost during the upgrade path it's easy to just configure the triggers again - there's nothing irreversible here.
Also it's fairly minor compared to the configuration changes that usually need to be made when doing a major version upgrade.
Comment #20
readyman commentedDrupalcon Sydney
Comment #21
readyman commentedToo adventurous for our first attempt. Needs re-roll due to PSR-0
Comment #22
welly commentedHave re-rolled the patch. Please review!
Comment #23
ZenDoodles commentedThank you @welly
Thanks for your patch, but it looks like there are some missing changes in other files?
We need the complete patch including the changes made in:
modules/simpletest/tests/upgrade/drupal-6.trigger.database.php
modules/simpletest/tests/upgrade/drupal-7.trigger.database.php
modules/simpletest/tests/upgrade/update.trigger.test
modules/simpletest/tests/upgrade/upgrade.trigger.test
modules/trigger/trigger.install b/modules/trigger/trigger.install
(Note: credit no_angel and damienwhaley too? http://core.drupalofficehours.org/task/1471)
Comment #24
vijaycs85Another re-roll...
Comment #25
deciphered@vijaycs84,
If possible, could you add an interdiff.txt (http://drupal.org/node/1488712, http://xjm.drupalgardens.com/blog/interdiffs-how-make-them-and-why-they-...) so the patch can be reviewed a little easier?