If I use such a string:
{BLOCK:block_1}{YOUTUBE:video_id}{BLOCK:block_2}
I get this error message:
* warning: Invalid argument supplied for foreach() in /path/to/drupal/modules/reptag/tags/block.tags.inc on line 47.
I worked around by commenting the line:
"#{BLOCK:(.*?):(.+?)}#e" => "theme('block', (object)_reptag_block_by_title('\\2','\\1'));",
in block.tags.inc, but that's not a patch!
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | block.tags_.inc_.patch | 452 bytes | mesca |
Comments
Comment #1
profix898 commented{BLOCK:block_2}is not a valid syntax. It should be{BLOCK:block:2}or stg. (see _reptag_block_help() for sample syntax) ...Comment #2
mesca commentedSorry if I wasn't clear. I was referring to the
{BLOCK:Contact Details}syntax, which calls a "user-defined block with the given title".Comment #3
profix898 commentedSorry! Got that wrong. Bugfix committed.
Comment #4
mesca commentedThanks, but your fix is not perfect, and sometimes it catches too much.
Here is a patch for the latest version of block.tags.inc. I simply replaced your regexp:
"#{BLOCK:([^:]+):(.+?)}#e"by:
"#{BLOCK:([^:!}]+):(.+?)}#e"Comment #5
mesca commentedHi profix,
Do you plan to commit the patch I sent? Do you have any chance to test it?
Comment #6
profix898 commentedMissed that completely! Sorry! I'm quite busy at work and updating my modules.
Could you post a list of strings to test against? That would be great :) I'm talking about cases currently failing and those to check all four regexp syntaxes with.
Comment #7
mesca commentedI've tested the following strings:
In some cases (when there was more than one tag in the same line and the first one has more than one argument) it was failing because the regexp didn't stop at the first '}'. My submitted patch solves that issue.
Comment #8
profix898 commentedBut what is the
!needed for? Why is it necessary to stop at the next!?{BLOCK:([^:}]+):(.+?)}should solve the problem of a series of tags being incorrectly treated as one, not?Comment #9
mesca commentedHmmm... you're absolutely right. The
!is needed for nothing! Mea culpa.Comment #10
profix898 commentedNo problem. Bugfix committed. Thanks :)
Comment #11
(not verified) commented