Closed (works as designed)
Project:
Block Node Visibility
Version:
6.x-1.0
Component:
Code
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
25 Aug 2010 at 04:06 UTC
Updated:
28 Apr 2011 at 05:26 UTC
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.
| Comment | File | Size | Author |
|---|---|---|---|
| block_node_visibility-node_identifier-6.x.patch | 545 bytes | AlexisWilke |
Comments
Comment #1
andypostBetter to use menu_get_object()
Comment #2
reck commentedthis patch does not work for the first page (home page) example: www.site.com/
Comment #3
AlexisWilke commentedreck,
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
Comment #4
reck commentedbut if I click on the logo link is / and not /node
Thank you.
Reck
Comment #5
AlexisWilke commentedRight, 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
Comment #6
reck commentedI followed your advice and now works !!!
your module is perfect
Thank you Alexis !!!!!
Comment #7
AlexisWilke commentedreck,
This is not my module, but thank you for supporting my patch. Maybe you dare mark this issue as RTBC. 8-)
Thank you.
Alexis
Comment #8
john.money commentedHi 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.
Comment #9
AlexisWilke commentedJohn,
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
Comment #10
john.money commentedI 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).