Node Info Boxes returning incorrect boxes for nodes
| Project: | Node Info Boxes |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Suuch |
| Status: | closed |
Jump to:
I have created a Drupal 4.7.3 site with Pathauto (pathauto.module 1.22.2.4) installed. I then installed Node Info Boxes (node_block.module 1.4) and added Info Boxes to most nodes on the site.
All seemed ok, but when I clicked thru and looked more closely I found that some nodes were displaying "Info Boxes" that were not associated with that node.
For example one node that gets the path "general" from pathauto displays its' associated info box correctly. However, another node which is given "general-information" by pathauto shows the info box that is associated with it AND the info box from "general".
When I double checked each node, both "general" and "general-information" had one and only one box associated with them via the "Info Boxes" tab.
The same problem occurs with "sexual-health" and "sexual-health-education", "tai-chi" and "tai-chi-for-arthritis"...
Seems like a problem with an SQL query here but I'm really not sure where to start looking for a solution.
Anybody else experiencing this?
Thanks,
Blue Square.

#1
Yes, it was a greedy query. This problem should be fixed with the current 4.7 version (1.5). Let us know if there are any further issues.
#2
Yeah that fixes the box display issue for newly created boxes nicely. I had to manually edit the boxes I had already created to remove the trailing '*' but after that it was fine.
However, the patch seems to have created a new issue for me. When I go to view a page the info boxes show up just fine, but when I click on the 'info boxes' tab, no boxes show up as being associated with that node.
If you change line 227 of node_block.module from;
$res = db_query("SELECT * FROM {blocks} INNER JOIN {boxes} ON bid=delta WHERE pages='%s' AND module='block'", $path.'*');
to read;
$res = db_query("SELECT * FROM {blocks} INNER JOIN {boxes} ON bid=delta WHERE pages='%s' AND module='block'", $path);
Blue Square.
#3
Fixed. Please try again.
#4
Works a treat! Feel free to go ahead and add this to the 4.7 distro.
Thanks for that.
Cheers,
BlueSquare.
#5
Done.