Hi there,

Thank you for the module, I was wondering if it were to ever be created 8-) Very useful!

The module checks for the node/# path where # is expected to be a numeric value. Note that node/0 is a valid path and should work (it represents <front>).

The attach patch offers a simple solution: check whether arg(1) is numeric.

Comments

andypost’s picture

Better to use menu_get_object()

reck’s picture

this patch does not work for the first page (home page) example: www.site.com/

AlexisWilke’s picture

reck,

Your example is not a Drupal website. What do you expect there?

Also, the default front page is <yoursite>/node

Since you can change the front page, it is indeed not true all the time.

Thank you.
Alexis

reck’s picture

but if I click on the logo link is / and not /node

Thank you.
Reck

AlexisWilke’s picture

Right, when you go to Administer » Settings » Site Information you can change the home page (i.e. / by itself) to anything you want. If you don't, the default is /node.

And to make it clear: node or node/0 are the same page. Global Redirect can be used to remove the /0 from the URI, but you still will get the same problem in the test.

Thank you.
Alexis

reck’s picture

I followed your advice and now works !!!
your module is perfect
Thank you Alexis !!!!!

AlexisWilke’s picture

reck,

This is not my module, but thank you for supporting my patch. Maybe you dare mark this issue as RTBC. 8-)

Thank you.
Alexis

john.money’s picture

Hi Alexis and thanks for the patch!

I am unclear whether the proper node type will be loaded from node_load(0)... which I believe your patch would attempt. I will investigate further.

AlexisWilke’s picture

John,

Ah... You're right. I wonder why it worked better this way. I have to say I've not been using the module much since it makes use of the PHP feature which I generally turn off on my sites (for obvious security reasons.)

Hmmm....
Alexis

john.money’s picture

Status: Needs review » Closed (works as designed)

I am not going to keep the type cast since we don't want node load on node/0 (this is by design).

Node Visibility Block works for a node on front page. The args() reflect the correct node path, not or some other menu entry -- tested clean install 6.20.

Core (optional) PHP filter is not a requirement for this module -- tested clean install 6.20 just now.

Closing this ticket (but I appreciate you keeping discussion alive, I haven't used blocks in over a year).