Usually I get the proper url using url(...), so I tried the following:

In activity/modules/node.activity.inc, change

from:
Line 36: 'activity-node-link' => l($object->title, "node/{$object->nid}"),

to:
Line 36: 'activity-node-link' => l($object->title, url("node/{$object->nid}")),

but for some reason, it didn't create the proper path as it usually does....

Any ideas?

Comments

fizk’s picture

This didn't work either:
'activity-node-link' => l($object->title, url("node/{$object->nid}", array('absolute' => TRUE))),

Scott Reynolds’s picture

Status: Active » Postponed (maintainer needs more info)

Why are you changing that? l() uses the url() function already. http://api.drupal.org/api/function/l/6

function l() {
//.....
return '<a href="'. check_url(url($path, $options)) // ....

What is 'improper' about the existing code?

fizk’s picture

Normally, url('node/123') might return "/content/some-title", but, so far, never returns "node/123".

For some reason, url("node/123") is returning "node/123". I want it to return "/content/some-title" as it usually does.

Scott Reynolds’s picture

Ha your right. i just never noticed because of Global Redirect. Might have to do with system.weight here. Pathauto (or Path) hook_nodapi() firing AFTER Trigger's

Scott Reynolds’s picture

Status: Postponed (maintainer needs more info) » Active

marking as active

fizk’s picture

StatusFileSize
new0 bytes

Here's my list generated by a node insert

fizk’s picture

I think you're right. The list show that all the relevant functions are called before pathauto_token_values:

...
module_invoke_all::comment_token_values
module_invoke_all::node_token_values
module_invoke_all::taxonomy_token_values
module_invoke_all::user_token_values
module_invoke_all::activity_token_values
...
...
module_invoke_all::pathauto_token_values

So how do we make sure that pathauto_token_values are called first? Should pathauto somehow set it's weight higher or should activity set its weight lower?

It'd be nice if there was a way to say "my token_values depend on another token_values being setup first".

fizk’s picture

Alrighty, I used the util module to change the weights and it's calling pathauto before activity now, but it didn't help :|

fizk’s picture

StatusFileSize
new0 bytes

Here's the list of node_invoke_nodeapi. pathauto_nodeapi is called just before activity_nodeapi.

Scott Reynolds’s picture

Its not activity_nodeapi thats the problem. Its trigger_nodeapi.
But having said that I tried adjusting the weights and it didn't work. There is something else.

all your files are empty.

fizk’s picture

I don't know if this is related, but [activity-node-creator-link] returns "Anonymous", even though [author-name] returns the correct username.

Scott Reynolds’s picture

Status: Active » Fixed

so #11 isn't related (we talked on irc)

http://drupal.org/cvs?commit=317638

fizk’s picture

doesn't seem to fix it for me :( I wanted to try CVS head, but it says "This version is incompatible with the 6.15 version of Drupal core." on the modules page.

Scott Reynolds’s picture

its not CVS HEAD but the DRUPAL-6--2 branch.

Scott Reynolds’s picture

Status: Fixed » Needs work

ok So this morning I just tested it using the path module (i.e. not path auto). And it worked, but to confirm try turning off automatic alias at the node form and specifying some path.

http://skitch.com/supermanscott/nttpq/create-story-scotts-contrib

Confirm that when you do that it works. Just to make sure Im not crazy.

fizk’s picture

Status: Needs work » Fixed

So what I did was

1. create a node with automatic alias on
2. edit the node to turn automatic alias off and specify a path
3. see if activity links to the path alias

activity didn't show the path alias, still showed node/xxx

fizk’s picture

Status: Fixed » Needs work
Scott Reynolds’s picture

ok i got it to work by running this

update system set weight = 2 where name = 'trigger';

edit: with the latest code from CVS

fizk’s picture

not working yet, what's your activity weight?

Scott Reynolds’s picture

StatusFileSize
new4.77 KB

ok committed to CVS, D.o is having some trouble right now so can grab the commit link

http://drupalcode.org/viewvc/drupal/contributions/modules/activity/activ...

Scott Reynolds’s picture

Status: Needs work » Fixed

It will be rolled into the next .dev. You can check out of CVS using DRUPAL--6-2 tag (see: http://drupal.org/node/177860/cvs-instructions/DRUPAL-6--2)

fizk’s picture

StatusFileSize
new286.24 KB

Encrypted system.sql dump

openssl aes-256-cbc -in system.sql.txt -out system.sql -d -a

password sent to you on IRC.

fizk’s picture

Status: Fixed » Needs work
Scott Reynolds’s picture

Status: Needs work » Needs review
StatusFileSize
new1.88 KB

Ok so I knew on at the beginning of this epic issue, that it had to with some modules static cache. The first thought it had to do with path modules static cache (hence drupal_clear_path_cache()). But it wasn't as any time a new path alias is added, that cache is cleared.

It ended up being token's cache. So token module statically caches its data, and because of pathauto uses token, and so token's static cache was built up by pathauto creating the alias.

So the trick was to flush tokens cache before rendering messages. Try this patch against the latest DRUPAL--6-2.

patch -i activity_656020.patch -p0

fizk’s picture

WORKS!!!!!!!!!!!!!

BOOYAAAA :P

I'll give you the honour of closing this ticket once and for all.

sadist’s picture

i'm still having the same problem eventho i'd patched or replaced it with the latest dev version.

i added an alias for so that anything www.drupal.site/node/* will go to www.drupal.site/go/*.

but at the same time, with pathauto.module, i set the path for video nodes to be video/[nid]

problem i'm having is that, activity.module will print it as "http://www.drupal.site/go/[nid]" to all activities.

here's my issue actually: http://drupal.org/node/691694

Scott Reynolds’s picture

Status: Needs review » Fixed

http://drupal.org/cvs?commit=317846

Goto: admin/reports/status and you should see a message from Activity telling you to click a link. If that link gives you a page not found, clear caches and click that link again. That should fix it.

Essentially, trigger has to be called after pathauto so it can use the pathauto's path to the node.

/me wishes he could just delete issues and pretend like they didn't happen.

sadist’s picture

hehe.. sorry for the trouble.. but this module rocks so much man! it's like the heartbeat for any social-networking site.

and my problem is solved now! with the latest dev version.. i really appreciate your hard work for this module.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.