Closed (fixed)
Project:
Block Title Link [D7]
Version:
6.x-1.6
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
6 Nov 2009 at 00:03 UTC
Updated:
23 Feb 2011 at 16:20 UTC
Using Taxonomy List, a Block is created with a Delta value of zero. In block_titlelink.module, in routine block_titlelink_validate you have a line:
if ($module && $delta) {
that fails if $delta has the value of zero. I changed this line to:
if ($module && (strlen($delta) > 0)) {
and then it worked. Sorry I don't know anything about creating patches or anything, but I hope this is helpful for fixing the problem in your next version.
Comments
Comment #1
ngmaloney commentedExcellent. Thanks for the fix. I'll roll out an update.
Comment #2
ngmaloney commentedRolling out patch now.
Comment #3
ngmaloney commentedRolled out version 6.x-1.4
Comment #4
TPerkins commentedA delta of 0 was still failing for me in version 6.x-1.4.
This always failed:
if ($module && ($delta || $delta === 0)) {
This worked:
if ($module && ($delta || $delta == 0)) {
Comment #5
ngmaloney commentedI'll test again. The problem I was having was by using the "==" operator if the $delta was FALSE, or NULL it would still return 0, where as using "===" is the literal comparison operator and would ONLY evaluate if the $delta was equal to the int 0.
Comment #6
neclimdulIt will however fail if it is the string 0. a lovely php gotcha and a reason numeric delta's on blocks suck.
Should fix it.
Comment #7
sammo commentedI can confirm this is still an issue in 1.6. The comment in #6 resolves the problem.
Comment #8
ngmaloney commentedAdded patch specified in #6. New release 6.x..1.7 is now available.