I get this error when trying to update a node that Amplify is associated with.

Fatal error: Call to undefined function qpservices_amplify_key() in /users/ittags.com/htdocs/sites/all/modules/amplify/amplify.module on line 360

K

Comments

pescetti’s picture

Subscribing, same problem. Actually, I get the error message upon node creation.
I'm using openquery 1.3, if this helps.

mbutcher’s picture

Status: Active » Fixed

My apologies. I had inadvertently left a reference to my testing module, qpservices, in the module. I've cut a 1.1 release to fix this problem. The 1.1 release also adds a CSS file for the mood cloud.

If you are interested in taking a look at the qpservices module, which adds tie-ins to Amazon, Flickr, Technorati, and Twitter, let me know. (It's the module shown in the Amplify screencast from the home page)

pyxio’s picture

YES!!!!!!!!!!!! on the qservices! Thanks for the fast updates, Matt. Good stuff.

pyxio’s picture

i updated and now I get this when i click the Amplify settings warning: call_user_func_array() [function.call-user-func-array]: First argument is expected to be a valid callback, 'amplify_admin_form' was given in /users/ittags.com/htdocs/includes/form.inc on line 366.

K

mbutcher’s picture

Clear the cache. That should clean that up.

pyxio’s picture

nope. i tried it on several different browsers and cleared the cache several time. Still the same error message.

mbutcher’s picture

mbutcher’s picture

Version: 6.x-1.0 » 6.x-1.1

I am having a bad day, I guess. :) When checking in files for the release, I somehow managed to miss one.

As a result, I've had to add a new 1.2 release.

At this rate, I'll be at release 1.12 by the end of the day.

pyxio’s picture

yes ... here is another to work on ;o) this occurs when trying to update a node.

# recoverable fatal error: Object of class QueryPathImpl could not be converted to string in /users/ittags.com/htdocs/sites/all/themes/theme201/block.tpl.php on line 9.
# recoverable fatal error: Object of class QueryPathImpl could not be converted to string in /users/ittags.com/htdocs/sites/all/themes/theme201/block.tpl.php on line 9.

mbutcher’s picture

Haven't been able to reproduce this one. Can you give me a little more information?

pyxio’s picture

So i just enabled a content-type (the same one) for both Amplify and Qpservices. I enabled a couple blocks. I go to the node and make a small edit so that it can be analyzed. On save i get this error

Fatal error: Call to a member function isSameNode() on a non-object in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 884

this is likely different than the one above .. but since i can't go any further I suppose we need to deal with this one first.

pyxio’s picture

it looks like the error has to do with blocks. content appears to be getting' amplified' ok without the blocks enabled.

mbutcher’s picture

Which blocks do you have enabled? I am testing right now with mood cloud and basic info...

mbutcher’s picture

I also noticed that qp cache had an error in its table definition. That would occasionally cause amplified documents to not return properly. I fixed that and added a new querypath 1.4 release.

That may or may not be what is at issue here.

I now have all of the qpservices blocks and both of the amplify blocks turned on, and am testing everything.

mbutcher’s picture

I've made snapshots releases of qpservices and amplify available so that you can see the latest dev work without needing to wait for a release.

pyxio’s picture

cool. i'll be testing it today. keep in mind i'm in europe so if you're in the U.S., depending which coast you're on... i'm 6-9hrs ahead of you. cheers, Kevin

pyxio’s picture

i just tested and am coming up with the following errors. i have updated all modules to latest -dev build. i have run update.php and cleared cache. i enabled only the two basic info blocks so far. then i tried to edit an existing node (update it) and I get the white screen with error

Fatal error: Call to a member function isSameNode() on a non-object in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 884

if i click back on the browser i see the edit form. if i click view i see the following error

* warning: file_get_contents(http://portaltnx.openamplify.com/AmplifyWeb/AmplifyThis?apiKey=66fn2rhph...) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 204 No Content in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1127.
* warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1075.

hopefully you can tell from the error what's going on. let me know asap, i'm keen to give it another try. cheers, Kevin

katbailey’s picture

Hey all,
I've been playing with this too and have come across some of the above errors. Regarding the "Call to a member function isSameNode()" error, I solved it by adding a check that !empty($first) on that line, i.e. changing line 884 from:

    if ($first instanceof DOMDocument || $first->isSameNode($first->ownerDocument->documentElement)) {

to

    if (!empty($first) && $first instanceof DOMDocument || $first->isSameNode($first->ownerDocument->documentElement)) {

As for the "Object of class QueryPathImpl could not be converted to string", the block functions do indeed seem to be returning QueryPathImpl objects instead of strings. There's probably meant to be an intermediate function to convert it to a string but in order to get it to work I changed them to return strings instead, e.g. for the mood cloud function (leaving in the original code that uses $out as opposed to $output but commenting out the return statement):

function amplify_get_mood_cloud ($node) {
  $qp = amplify_get_qp($node);
  
  // If no cached doc was found, we skip.
  if (empty($qp)) {
    return 'Empty mood cloud for ' . $node;
  }
  
  // This contains the styling for this module.
  drupal_add_css(drupal_get_path('module', 'amplify') . '/moods.css');
  
  $out = qp('<?xml version="1.0"?><div class="tagcloud"/>', 'div');
  $output = '<div class="tagcloud"/>';
  foreach ($qp->find('TopTopics>TopicResult')->slice(0, 10) as $topic) {
    $name = check_plain($topic->find('Topic>Name')->text());
    $polarity = check_plain($topic->end()->find('Polarity>Mean>Name')->text());
    $guidance = check_plain($topic->end()->find('OfferingGuidance>Name')->text());
    
    $pol_class = 'polarity-' . strtolower($polarity);
    $guid_class = 'guidance-' . strtr(strtolower($guidance), ' ', '-');
    $classes = $pol_class . ' ' . $guid_class . ' amplified-tags';
    
    $out->append('<span class="' . $classes . '">' . $name . '</span> ');
    $output .= '<span class="' . $classes . '">' . $name . '</span> ';
  }
  $output .= '</div>';
  //return $out->top()->xml(TRUE);
  return $output;
}

Anyway, really nice work! This is seriously awesome stuff, I look forward to playing around with it some more :-)

Katherine

pyxio’s picture

thanks for the awesome work, Katherine. I'm not much of a coder but I look forward to updating the modules once Matt has incorporated your fixes into the build. Cheers, Kevin.

mbutcher’s picture

Version: 6.x-1.1 » 6.x-1.2

katbailey: That first change is in QueryPathImpl.php, right? I believe it has already been fixed in QP 2.0 Alpha 1, but that might require some backporting. It's actually related to the second issue directly.

For the second one, I believe the TRUE passed into xml() is causing the problem. I'll remove that. (The TRUE is allowed in QueryPath 2.0, but not in QueryPath 1.2, where it gets cast to a string.)

Actually, I changed it to html() (instead of xml()), which should work fine in this context.

Man... in the end it all comes down to removing that pesky TRUE.

pyxio’s picture

matt,

have you updated the build? can i try it yet? K

mbutcher’s picture

* warning: file_get_contents(http://portaltnx.openamplify.com/AmplifyWeb/AmplifyThis?apiKey=66fn2rhph...) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 204 No Content in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1127.
* warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1075.

I was having that problem last night, too. It is coming from the OpenAmplify server. Testing again to see if I can catch the error condition and make a pretty informative error instead of stack barf.

mbutcher’s picture

The code is updated. You can check it out from CVS or wait for the dev build (which happens every 12 hours... and I don't know on what hour)

Matt

pyxio’s picture

i guess i have to wait then. i know nothing about cvs ;o( will try to experiment with it tomorrow then. K

mbutcher’s picture

iteego: If you switch to QueryPath 2.0 Alpha 1, it should be working without the batch of fixes I made today.

http://github.com/technosophos/querypath/downloads

pyxio’s picture

the contents of this folder looks very different than before. Is that correct? should i upload all of those folders?? docs, examples, patches, src, test etc?

pyxio’s picture

anyway, that is one serious upload. as big as panels! Once it ever finishes I'll test it.

pyxio’s picture

i have cancelled the upload. its way too big. will wait for the -dev releases.

mbutcher’s picture

iteego: You only need 'src/'. The rest of the folders contain API documentation, unit tests, patches contributed from elsewhere, and so on.

Hmm... a thought just occurred to me... maybe people would like a minimal QueryPath download. That'd cut the download to somewhere around a few hundred K.

pyxio’s picture

Fatal error: Call to undefined function qp() in /users/ittags.com/htdocs/sites/all/modules/amplify/amplify.module on line 387

same ... i try to update a content type associated with amplify,

pyxio’s picture

I'm done for the day. I really had hoped to do some fun things with this module today. I don't know if its only me but it seems i get errors anytime I add a block. See you tomorrow.

pyxio’s picture

updated all modules ... still getting this error. I have not been able to see this module in action yet. can somebody help?

Fatal error: Call to a member function isSameNode() on a non-object in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 884

mbutcher’s picture

Sounds like you have the QueryPath library in the wrong place. Just the contents of src (from the QueryPath download) should be placed in the root directory of the QueryPath module. In other words, you should have a directory listing that looks like this:

qpcache/
GPL.txt
LGPL-2.1.txt
QueryPath/
README.txt
querypath.admin.inc
querypath.classes.inc
querypath.install
querypath.module
querypath_examples.module
querypath.info
querypath_examples.info

And inside of QueryPath/ you should have QueryPath.php and the other QueryPath files. You don't need docs, tests, or any of those additional directories.

Refer to the QueryPath README for more.

pyxio’s picture

that's not the problem. my directories are setup correctly. I just double-checked. In fact you can see from the error message that the directories are OK sites/all/modules/querypath/QueryPath/QueryPathImpl.php

pyxio’s picture

here is another version of the error

* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /users/ittags.com/htdocs/includes/database.mysql.inc on line 321.
* recoverable fatal error: Object of class QueryPathImpl could not be converted to string in /users/ittags.com/htdocs/sites/all/themes/theme201/block.tpl.php on line 9.

pyxio’s picture

i have the blocks working ... but lots of errors unfortunately.

recoverable fatal error: Object of class QueryPathImpl could not be converted to string in /users/ittags.com/htdocs/sites/all/themes/theme201/block.tpl.php on line 9.

pyxio’s picture

* warning: file_get_contents(http://portaltnx.openamplify.com/AmplifyWeb/AmplifyThis?apiKey=66fn2rhph...) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 204 No Content in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1127.
* warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1075.
* This content has been modified by another user, changes cannot be saved.
* recoverable fatal error: Object of class QueryPathImpl could not be converted to string in /users/ittags.com/htdocs/sites/all/themes/theme201/block.tpl.php on line 9.

pyxio’s picture

another

warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /users/ittags.com/htdocs/includes/database.mysql.inc on line 321.

this is a REALLY awesome set of modules and I can't wait for a more stable release. at this point, it's way to buggy for a production environment. i will be keeping an eye on these and am very anxious to integrate this into my site. please keep me posted on the progress. if i can do anything more to help debug let me know. cheers, Kevin

mbutcher’s picture

Re: #37, that is one of the errors generated when OpenAmplify's server cannot be contacted. Still trying to figure out how to catch this particular error, since it doesn't get reported through the exception channel that DOM usually uses. That will be one of the fixes in QP 2.0 Alpha 2.

Looking into the others.

mbutcher’s picture

Latest dev release of qpservices should now be 100% compatible with QueryPath 1.2. You'll still get much better performance off of 2.0 Alpha 1, though.

pyxio’s picture

i have tried alpha 1. and all latest releases. the errors are still there and they are triggered by amplify and/or querypath modules because i have turned them off and no more errors. K

mbutcher’s picture

Amplify now (whenever the next dev build gets autogenerated) correctly handles exceptions thrown by remote failures.

The next build of QueryPath (2.0 Alpha 2) will convert PHP errors into exceptions so that they are correctly handled instead of going straight to Drupal's error reporting mechanism. The reported errors above will probably not go away until QP 2.0 Alpha 2, since previous versions allow the IO system to trigger errors instead of throwing exceptions. OTOH, you should see these only rarely, since OpenAmplify should be online most of the time.

Still cannot find anywhere that would trigger the reported MySQL error. I wonder if Calais and Amplify are conflicting over something. Does turning off QPServices fix this? Or do you have to turn off both?

mbutcher’s picture

Status: Fixed » Active

Remarking this as active.

pyxio’s picture

Matt,

I tested without QServices.

* warning: file_get_contents(http://portaltnx.openamplify.com/AmplifyWeb/AmplifyThis?apiKey=66fn2rhph...) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 204 No Content in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1253.
* warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1161.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /users/ittags.com/htdocs/includes/database.mysql.inc on line 321.
* warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/amplify/amplify.module on line 184.

rsadasiv’s picture

Hey guys!

I'm Ram Sadasiv, Development Manager for OpenAmplify. First off, I think what Matt and all of you are doing with this Drupal module is really cool! I'll try to check in here more often in the future and keep up with how things are progressing.

I don't want to hijack this thread, and Matt please let me know if you want to handle these kind of support questions differently, but if you are having problems with the OpenAmplify service itself the quickest way to get my attention (and hopefully, get the OpenAmplify problem fixed ;)) is to post a bug report in the Tech Support forum on the OpenAmplify site - http://www.openamplify.com/forum/topics/19627.

mbutcher’s picture

Ram: Thanks! I really appreciate it.

http://www.openamplify.com/forum/read/48226

I forgot to post that issue number here when I posted to the OpenAmplify forum earlier today.

iteego: I am going to build you a version of the module that has extra error reporting in it. That way we can track down exactly where the SQL-based bug is originating. It'll be 1.3-Alpha1. Hope to have it up in a few hours.

Matt

mbutcher’s picture

Iteego: re: #44, I have checked in a debugging version of QPCache.

Grab this release http://drupal.org/node/407234

It should have a date stamp from today (June 9/10)

This release should print out additional debugging information when the MySQL error occurs. With that, we should be able to figure out what is causing the database error.

Matt

pyxio’s picture

I get this error when editing content and saving Fatal error: Call to undefined function qp() in /users/ittags.com/htdocs/sites/all/modules/amplify/amplify.module on line 390

so i am unable to get any further to find the MySQL printout

mbutcher’s picture

Did you overwrite sites/all/modules/querypath/QueryPath when you did the update of the querypath module? You'll still need QueryPath/* for the module to function.

pyxio’s picture

i didn't overwrite anything. all directories and files are where are supposed to be. K

pyxio’s picture

wait ... maybe I did. I'm checking into this now.

pyxio’s picture

that was the problem. sorry about the oversight. so here is the error

* warning: file_get_contents(http://portaltnx.openamplify.com/AmplifyWeb/AmplifyThis?apiKey=66fn2rhph...) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 204 No Content in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1253.
* warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1161.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /users/ittags.com/htdocs/includes/database.mysql.inc on line 321.
* warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/amplify/amplify.module on line 184.
* An error occured retrieving some content

i'm in #drupal-amplify if you want to log in and work on solving this with me. K

pyxio’s picture

i don't see any special debugging output. just the same errors as usual

warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /users/ittags.com/htdocs/includes/database.mysql.inc on line 321.

mbutcher’s picture

Hmm... I added debugging to all of the SQL in querypath so that any array that was passed into a SQL statement would generate a message. Judging by the above, no array ever got passed directly in.

Gonna have to hunt for the bug elsewhere... maybe in the node loading.

BTW, are you still seeing a lot of 204 errors? OpenAmplify is looking at that issue.

Matt

pyxio’s picture

Matt,

I'm not seeing an errors because unfortunately I had to uninstall the modules. When you get a little closer to resolving the issues let me know. Thanks, Kevin

pyxio’s picture

just noticed you has some updates to amplify and qpservices. i tried them out and still getting the same error

warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /users/ittags.com/htdocs/includes/database.mysql.inc on line 321.

because of this error the amplification process breaks and does not complete itself.

pyxio’s picture

if this is what you mean by the 204 error, yes ... still getting it about 1 out of every 3 nodes I amplify.

* warning: file_get_contents(http://portaltnx.openamplify.com/AmplifyWeb/AmplifyThis?apiKey=66fn2rhph...) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.1 204 No Content in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1253.
* warning: DOMDocument::loadHTML() [function.DOMDocument-loadHTML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/querypath/QueryPath/QueryPathImpl.php on line 1161.
* warning: mysql_real_escape_string() expects parameter 1 to be string, array given in /users/ittags.com/htdocs/includes/database.mysql.inc on line 321.
* warning: DOMDocument::loadXML() [function.DOMDocument-loadXML]: Empty string supplied as input in /users/ittags.com/htdocs/sites/all/modules/amplify/amplify.module on line 181.
* An error occured retrieving some content

mbutcher’s picture

The Devel module might help isolate the errors in #56 and #57. The problem is that I have no idea what could be generating the MySQL error. It doesn't appear to be anything inside of the QP/Amplify modules, so it is probably happening in some other function call made from the module into Drupal core.

mrchristian’s picture

Hi

Did anyone ever get a fix to the problem error

recoverable fatal error: Object of class QueryPathImpl could not be converted to string in /opt/oss/apache2/htdocs/drupal6.multisite/themes/garland/block.tpl.php on line 10

thanks

simon

mrchristian’s picture

hi

the fix is that you need to have version 2.0 of QueryPath

after investigating your problem I suggest you need to uninstall
QueryPath then install a newer version:

http://github.com/technosophos/querypath/downloads

Apparently you need 2.0

simon

mbutcher’s picture

Simon,

Yes, that is the preferred fix for the issue.

Let me know if you encounter the database error also reported in this thread. I cannot replicate it, and I've been trying for weeks.

Matt

mbutcher’s picture

Status: Active » Closed (fixed)

No additional reports were made after #61, so I am marking this closed.