Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
The simplehtmldom PHP lib has its funcs unprefixed..
The most probable reason for name collisions is when someone would use another copy of the same library ..
Either before this module is installed or aftrer.
Currently the module checks for function's existance but sth is not right since this seems not to work...
EDIT: It seems that there is a stupid bug in the module causing this... The function_name var is empty...
Comments
Comment #1
rsvelko CreditAttribution: rsvelko commentedI will clean this up someday, maybe :) Until then - all other modules that need simplehtmldom - Please, just use this module! Or make me use your module and trash this one - if you've got sth better.
Comment #2
xurizaemonNo need to define a $function_name variable if you're only using it once. Just check for the existence of the Simple_HTML_DOM class and you're gold.
That doesn't resolve the issue of the function names being unprefixed. As you're embedding the library in your module, 3rd Party Modules in Drupal CVS suggests it's OK to rename those functions to prefix them to Drupal coding standards.
If you're not doing that then it seems (to me) more sensible to just use
sites/all/libraries
and require_once() as required.Comment #3
Konstantin Komelin CreditAttribution: Konstantin Komelin commentedI mark it as duplicate of #1009282: Notice: Undefined variable: function_name in include_once() (line 7 of .../sites/all/modules/simplehtmldom/simplehtmldom.module) and #1047944: Consider sites/*/libraries or use of Libraries API.
Thanks to all for your efforts.
Konstantin
Comment #4
Konstantin Komelin CreditAttribution: Konstantin Komelin commented