If you change the path, mgo breaks. Not cool.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Status: Needs review » Needs work

The last submitted patch failed testing.

chx’s picture

Status: Needs work » Needs review
FileSize
1.66 KB

bah! Btw we could shorten to if ($function == $target && !$count--) but I am afraid of webchick's wrath to submit that :)

Status: Needs review » Needs work

The last submitted patch failed testing.

chx’s picture

Well comment preview breaks because it uses menu_get_object to check for a node page but finds itself and thus breaks. That needs fixing. We probably want to add a router_path retriever so you can do menu_router_path_get() == 'node/%'.

pwolanin’s picture

This is some nastiness around %user_uid_optional vs %user that make this function mostly useless for non-node pages anyhow.

If our objects were not stdClass but something sensible, this function could happily return an object from a single load function and the receiver could change behavior based on the object class.

Anyhow - we need to better define what a 'node' page means - by many definitions the comment module behavior is broken. What it seems to want to know is whether the tab root is node/%

chx’s picture

Status: Needs work » Needs review
FileSize
2.87 KB

Fixed up comment module hopefully and also doxygen which was wrong as pwolanin points out with 'user'. I have fixed menu_get_object to work with user as it should: now specifying user also covers user_uid_optional. This addition made $target into an array which allowed me to use PHP array functions instead of that slow for-if construct.

Status: Needs review » Needs work

The last submitted patch failed testing.

RobLoach’s picture

I've noticed that menu_get_item() doesn't retrieve the user object if you're on a user/% page. A menu_router_path_get() function would be helpful too so that you know what object you're getting from menu_get_object().

grendzy’s picture

I noticed this today to - menu_get_object('user') doesn't work on user/%.

chx’s picture

Assigned: chx » Unassigned
Issue summary: View changes