* notice: Undefined variable: mtch in insert_view/insert_view.module on line 113.
* notice: Undefined variable: repl in insert_view/insert_view.module on line 113.

PHP notice when a view does not exists.

CommentFileSizeAuthor
#4 313329_php_notice.patch760 bytespasqualle

Comments

pasqualle’s picture

Status: Active » Needs review

in function _insert_view_substitute_tags($text)

move

return str_replace($mtch, $repl, $text);

inside the if ($view) {} statement

mlsamuelson’s picture

Status: Needs review » Postponed (maintainer needs more info)

Pasqualle,

I'm not able to reproduce the notices.

Additionally, if we move the return code inside the if ($view) {...} we break the ability to insert more than one view in a node.

Can anyone confirm the notices? I'm wondering if maybe they occurred with an earlier version of Views 2.

mlsamuelson

pasqualle’s picture

Status: Postponed (maintainer needs more info) » Needs work

repro steps:
1. install drupal-6.x-dev
2. enable views and insert_view modules
3. enable insert view filter
4. create a node with [view:noview]

I can confirm that the patch is not correct because it indeed breaks the ability to insert more than one view in a node.
marking CNW

pasqualle’s picture

Status: Needs work » Needs review
StatusFileSize
new760 bytes

new patch

you need to use drupal-6.x-dev (or hack common.inc) to see the PHP notices
more details here: #291026: change E_NOTICE to warning and allow selection of error level

pasqualle’s picture

Assigned: Unassigned » pasqualle
pasqualle’s picture

Version: 6.x-1.x-dev » 6.x-2.x-dev
Status: Needs review » Closed (fixed)