Hi,
Version 7.x-1.11 - I installed on a fresh Drupal 7 rc3 installation, module threw the following warning:
Notice: Undefined variable: function_name in include_once() (line 7 of ......../sites/all/modules/simplehtmldom/simplehtmldom.module).

Simple suggested fix, replace line 7 with the following:

 if (!function_exists('str_get_html')) {
CommentFileSizeAuthor
#1 simplehtmldom011811.patch552 byteslorinpda

Comments

lorinpda’s picture

Status: Active » Needs review
StatusFileSize
new552 bytes

Hi,
I am submitting a patch which implements the change detailed above.

Please note, I have a CVS/Module application posted here http://drupal.org/node/954770. My module "Tumblr_Connect" requires use of simplehtmldom :) A few users requested the Drupal 7 version.

Hope this helps :)
Lorin

xurizaemon’s picture

Issue tags: +Libraries

I considered doing something similar, but my plan was to use the class name because the odds of those function names conflicting with something else seemed too high.

if (!class_exists('simple_html_dom_node') ) {
  require_once('simplehtmldom/simple_html_dom.php');
}

This issue is a duplicate of #922874: Notice: Undefined variable: function_name in include_once() (line 7 of ...simplehtmldom/simplehtmldom.module) (that for 6.x, this for 7.x).

We probably won't use this module, as for reasons stated in #1047944: Consider sites/*/libraries or use of Libraries API it seems simpler to just reference the library instead.

xurizaemon’s picture

Title: A small change request Version 7.x-1.11 » Notice: Undefined variable: function_name in include_once() (line 7 of .../sites/all/modules/simplehtmldom/simplehtmldom.module)

Adding meaningful issue title.

jordojuice’s picture

Yeah... this needs to be fixed! This is a big issue. I don't want to have to tell people they need to apply patches to use my module!

Konstantin Komelin’s picture

Issue summary: View changes
Status: Needs review » Fixed

I think it's been already fixed. Let me know if it is still actual issue.

Please use 7.x-2.x instead of 7.x-1.x branch because it includes simplehtmldom library as an external dependency.

Thanks.
Konstantin

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.