I am using Drupal 6.15 and have been trying to implement the Import Html module. I have tried to import a very basic .html file to no avail. I keep getting this message:

* warning: Parameter 2 to menu_import_html() expected to be a reference, value given in C:\wamp\www\drupal-6.15\includes\module.inc on line 483.
* warning: Parameter 2 to node_import_html() expected to be a reference, value given in C:\wamp\www\drupal-6.15\includes\module.inc on line 483.
* warning: Parameter 2 to path_import_html() expected to be a reference, value given in C:\wamp\www\drupal-6.15\includes\module.inc on line 483.
* warning: Parameter 2 to taxonomy_import_html() expected to be a reference, value given in C:\wamp\www\drupal-6.15\includes\module.inc on line 483.
* warning: Parameter 2 to user_import_html() expected to be a reference, value given in C:\wamp\www\drupal-6.15\includes\module.inc on line 483.
* No body content found in this node

I have tried a couple different html pages and gotten the same message.
I am using WAMP with Apache 2.2.11 and PHP 5.3.0
I have checked my phpinfo(), it shows that both tidy and XSL are included.

Any insight as to the origin of these errors would be greatly appreciated.

CommentFileSizeAuthor
#9 686066-9.patch2.44 KBroderik
#7 686066.patch2.5 KBstella
#4 686066-2.patch2.44 KBroderik
#2 686066.patch2.44 KBroderik

Comments

dman’s picture

Status: Active » Postponed

First please try the dev version. There's not a lot in it that I'd expect to be worse than the old stable release, but there's been a lot of small improvements over time. I'm just reviewing/testing it again now and will make a 6-1.1 release soon.

Then, if you still get the error, you can increase the debug level and look at the logs. Debug logging is set in 'advanced' settings of the import profile settings.
I'm pretty sure that whatever this error is, it's not repeatable in the current -dev.

roderik’s picture

Title: Import Html Issues » PHP5.3 by-reference errors
Version: 6.x-1.0 » 6.x-1.x-dev
Component: Miscellaneous » Code
Category: support » bug
Status: Postponed » Needs review
StatusFileSize
new2.44 KB

Actually it's not over.

It's PHP5.3 related, which is stricter about how you can pass things by-reference. Or something.

From what I gather, module_invoke_all() does not work if one of your passed arguments is by-reference... because func_get_args() and/or call_user_func_array() messes something up.
And this won't be fixed before D8 :(
References I found:
http://drupal.org/node/360605#comment-1207303
http://drupal.org/node/615058#comment-2253356
#353494: Remove node_invoke(), comment_invoke(), etc

Possible solutions:
1) don't pass things by-reference. (I assume that's not an option. I didn't even look.)
2) don't use module_invoke_all(). See patch.

roderik’s picture

By the way, you can't see in the patch...
...but I gathered that hook_import_html_after_save() can have a third $datadoc argument, from looking at node.inc.

roderik’s picture

StatusFileSize
new2.44 KB

Hm. The previous patch applies to 6.x-1.x-dev with large offsets (-86 lines). Maybe you like this one better.

wigglykoala’s picture

I'm getting same error messages as original issue.

Set up is:
Drupal 6.17
Apache/2.2.12 (Win32) DAV/2 mod_ssl/2.2.12 OpenSSL/0.9.8k mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0
XSL extension is available.

Applied patch (by hand as things have moved about again!) and finally it works.

Had to switch to simplehtml2simplehtml.xsl but thats my problem not yours!!

jrsinclair’s picture

I was getting the same errors too, but the patch fixed it. Thanks.

For interest, my setup is PHP 5.3.0 on MAMPP OSX with Drupal 6.1.9

stella’s picture

StatusFileSize
new2.5 KB

Patch re-roll

alexmc’s picture

Stella: Which version of the module does this apply to? It wouldn't apply to my latest version of the dev file basically because patch didn't know how to put the two new functions at the end.

Once I applied that manually several problems disappeared (but a few more appeared :-(

roderik’s picture

StatusFileSize
new2.44 KB

re-roll

roderik’s picture

Status: Needs review » Closed (duplicate)

This is now fixed by dman in his own way.
(Or duplicate of #998554. I don't get the error messages in the last comment, it looks like they should be solved already...)

dman’s picture

Yeah I'm doing huge things to the main -dev module. Adding features support etc, a bit volatile this week.
I rolled in these fixes during downtime while thinking about something else - should have credited back to this thread :-/ - was just so trivial to fix (though admittedly nagging to some for a while)

In good news, big dev includes new support for remote repositories and sources of taxonomies.
- eg http://features.coders.co.nz/node/7

Thanks for the input folk, no good reason for the delay.