While debugging a custom resource, I was incorrectly constructing my query causing an exception to be raised in services_resource_execute_index_query(). However, the exception handling code raised this exception:

Call to undefined method PDOException::message() in PATH_TO_MY_DRUPAL_INSTALL/s
ites/default/modules/contrib/services/services.module on line 555

I believe that this can be fixed by changing line 555 of services.module to read:

return services_error(t('Invalid query provided, double check that the fields and parameters you defined are correct and exist. ' . $e->getMessage()), 406);

i.e. changing $e->message() to $e->getMessage()

CommentFileSizeAuthor
#5 fix_index_error.patch627 bytesmarcingy
#1 pdo_error.patch589 bytesmarcingy

Comments

marcingy’s picture

Status: Active » Needs review
StatusFileSize
new589 bytes

And here it is a patch

Status: Needs review » Needs work

The last submitted patch, pdo_error.patch, failed testing.

marcingy’s picture

Status: Needs work » Needs review

#1: pdo_error.patch queued for re-testing.

Status: Needs review » Needs work

The last submitted patch, pdo_error.patch, failed testing.

marcingy’s picture

Version: 7.x-3.1 » 7.x-3.x-dev
Status: Needs work » Needs review
StatusFileSize
new627 bytes
marcingy’s picture

Status: Needs review » Fixed

Committed as this was just a re-roll from the other issue

Status: Fixed » Closed (fixed)

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

Anonymous’s picture

Issue summary: View changes

Clarified my suggested fix.