While trying to install activity with drush, I get the following error:

drush en activity
The following projects will be enabled: trigger, activity
Do you really want to continue? (y/n): y
trigger was enabled successfully.                                    [ok]
activity was enabled successfully.                                   [ok]
In order for proper Pathauto behavior with Activity module, the      [error]
Trigger module's weight needs to be fixed up. Click here to fix
Trigger's weight
An error occurred at function : drush_pm_enable                      [error]

So I installed it without drush...

CommentFileSizeAuthor
#7 981860-adjust_trigger_weight.patch782 byteslangworthy

Comments

Scott Reynolds’s picture

Status: Active » Postponed (maintainer needs more info)

Thought I responded to this already.

This isn't a bug. There is clearly a error message that says, "hey you have to do something first prior to installing this". This error message only comes up when you have pathauto installed. Drush didn't install because it was going to cause an issue on your system.

Where is the bug?

MattHer’s picture

The Bug?

It was impossible to "Click here to fix" the issue. If you say, that this is not a problem of activity, it might be a feature request for drush.

Scott Reynolds’s picture

Title: installing with drush » Adjust Trigger module's weight automatically on install.
Status: Postponed (maintainer needs more info) » Active

Hmm, I was a bit to harsh here.

Perhaps we should just adjust the weight of Trigger automatically instead. The rational for not doing that originally was because messing with module weights of OTHER modules is, what I would consider, a bad thing(tm) without user approval. But really, what does user approval do for us here?

Perhaps the approach should be, Adjust the weight automatically and set a message informing the user that it happened.

j0e’s picture

Hi Scott, This is happening to me when I install Activity without using Drush. Even if I find a way to do it manually in the meantime until the proposed automatic solution is integrated, it's also not clear to me what the weight priority should be. I'm assuming Trigger is supposed to be lighter than Path Auto. And also, what weight setting would be appropriate for Trigger without affecting any other modules in my installation.
Thanks,
Joseph

Scott Reynolds’s picture

J0e did you click the link in the message? admin/activity/weight .

And also, what weight setting would be appropriate for Trigger without affecting any other modules in my installation.

The module does this by visiting that link by just setting the weight to 2. That shouldn't effect other modules.

j0e’s picture

I did click that link, but thought it didn't work because it didn't take me to a landing page or show a confirmation that the weight had been adjusted. So I take it now that once I clicked that link, all is well. Good to know.
Thanks,
Joseph

langworthy’s picture

StatusFileSize
new782 bytes

patch attached.

I wonder if this should happen in trigger.install or pathauto.install? Does this break any other assumptions?

langworthy’s picture

Status: Active » Needs review
marcp’s picture

Status: Needs review » Needs work

I don't think we should blindly set trigger's weight to 2. It's possible that pathauto and trigger may have already had their module weights adjusted already to make things work properly on the site. At the very least, we need to compare the pathauto and trigger modules weights and set one or the other (2 might not be high enough).

Can we fix the underlying issue without changing module weights? I haven't dug in enough yet to see what the exact problem is.

Scott Reynolds’s picture

Assumptions are the root of all evil ;-)


It's possible that pathauto and trigger may have already had their module weights adjusted already to make things work properly on the site. At the very least, we need to compare the pathauto and trigger modules weights and set one or the other (2 might not be high enough).

It does all those things you mentioned.

marcp’s picture

I think activity_bad_trigger_weight() needs to be tweaked a little because it's just checking to see if trigger weight is less than or equal to pathauto weight:

/**
 * Check to see if we need to fix the Trigger weight.
 */
function activity_bad_trigger_weight() {
  // Verify Triggers weight.
  $pathauto_weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'pathauto'"));
  if ($pathauto_weight !== FALSE) {
    $trigger_weight = db_result(db_query("SELECT weight FROM {system} WHERE name = 'trigger'"));
    return $trigger_weight <= $pathauto_weight;
  }
  return FALSE;
}

So, if trigger's weight is 6 and pathauto's weight is 7, then it seems like we're going to set trigger weight to 2. I might be reading the code wrong, though.

marcp’s picture

Just following up here since it's been a while and it looks like the bug exists in the 7.x branch as well. activity_fix_trigger_weight() sets trigger's weight to 2 regardless of what it was before.

_shy’s picture

Issue summary: View changes
Status: Needs work » Closed (outdated)

D6 reached its EOL back in February 2016, and there is no active release for D6 for this module anymore.
Development or support is not planned for D6. All D6-related issues are marked as outdated in a bunch.

If the issue remains relevant for D10+ versions, merge requests with proposed solutions for a new module version (D10+) are welcome in a new follow-up issue.

Thanks!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.