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

Pasqualle - September 25, 2008 - 13:48
Status:active» needs review

in function _insert_view_substitute_tags($text)

move

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

inside the if ($view) {} statement

#2

mlsamuelson - November 27, 2008 - 08:45
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

Pasqualle - November 27, 2008 - 11:45
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

Pasqualle - February 26, 2009 - 02:09
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

Pasqualle - March 24, 2009 - 23:24
Assigned to:Anonymous» Pasqualle
 
 

Drupal is a registered trademark of Dries Buytaert.