Download & Extend

PHP notice: Undefined variable: mtch

Project:Insert View
Version:6.x-2.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Pasqualle
Status:closed (fixed)

Issue Summary

* 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.

Comments

#1

Status:active» needs review

in function _insert_view_substitute_tags($text)

move

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

inside the if ($view) {} statement

#2

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

#3

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

#4

Status:needs work» needs review

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

AttachmentSize
313329_php_notice.patch 760 bytes

#5

Assigned to:Anonymous» Pasqualle

#6

Version:6.x-1.x-dev» 6.x-2.x-dev
Status:needs review» closed (fixed)
nobody click here