There is a problem in oa_core in function oa_core_get_parents() - the query is not wrote correctly for PostgreSQL. PostgreSQL is strict about fields types.
lines:
$query
->fields('n', array('nid'))
->condition('f.etid', $nid);
->condition('f.entity_type', 'node')
->orderBy('n.title')
->addTag('node_access');
will generate DB error as PGSQL will not allow pass example word 'All' as $nid value.
instead it we can make something like:
$query
->fields('n', array('nid'))
->condition('f.entity_type', 'node')
->orderBy('n.title')
->addTag('node_access');
if(is_int($nid)) {
$query->condition('f.etid', $nid);
}
This problem is in some point related to https://www.drupal.org/node/1932612 - with is still a issue in stable version of Drupal core.
Comments
Comment #1
ShadowMonster commentedI also had to comment cache functions in this function cause after install some module (I think rules) I run into infinite loop coming from reading all time cache until memory exhaust.
Comment #2
ShadowMonster commentedI know PGSQL is not officially supported but I don't see to big reason to not be if Drupal is. My installation work nicely expect some small problems related to DB. When my project will get live status I will generate compatibility patch.
Another similar situation around line 528:
Comment #3
Anonymous (not verified) commentedI had the same problem after upgrading to 7.x-2.22 - I'm just wondering if the simplest fix would be to pass $nid and $gid through intval()? This would equate to 0 when the value is 'All' which would then be the same behavior as MySQL.
Phase2 folks - are there any plans to roll a fix into the next OA release?
Comment #4
mpotter commentedI believe this is the same Drupal core bug as this issue #2247099: PostgreSQL issue: SQLSTATE[22P02]: Invalid text representation. Please try the D7 core patch mentioned at the end of issue #1003788: PostgreSQL: PDOException:Invalid text representation when attempting to load an entity with a string or non-scalar ID and see if that fixes it. Since this is a Drupal core issue, it's not something to be fixed in OA2 directly.