PHP notice: Undefined variable: mtch
Pasqualle - September 25, 2008 - 13:43
| Project: | Insert View |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Pasqualle |
| Status: | needs review |
Description
* 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.

#1
in function _insert_view_substitute_tags($text)
move
return str_replace($mtch, $repl, $text);inside the
if ($view) {}statement#2
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
#3
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
#4
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
#5