When creating a report, and attempting to add a data block, we are receiving the following error:

Fatal error: Call to undefined method DatabaseStatementBase::xpath() in /home/dpidatamanager/public_html/sites/all/modules/forena/renderers/FrxRenderer.inc on line 629 Call Stack: 0.0002 648672 1. {main}() /home/dpidatamanager/public_html/index.php:0 0.5810 109375544 2. menu_execute_active_handler() /home/dpidatamanager/public_html/index.php:21 0.5847 110103176 3. call_user_func_array() /home/dpidatamanager/public_html/includes/menu.inc:517 0.5847 110103920 4. forena_report_block_preview() /home/dpidatamanager/public_html/includes/menu.inc:0 0.5847 110104368 5. forena_data_block_preview() /home/dpidatamanager/public_html/sites/all/modules/forena/forena.report.inc:907 0.6029 113244648 6. FrxEditor->addBlock() /home/dpidatamanager/public_html/sites/all/modules/forena/forena.data.inc:61 0.7881 115527152 7. FrxTable->generate() /home/dpidatamanager/public_html/sites/all/modules/forena/FrxEditor.inc:825 0.7883 115527816 8. FrxRenderer->columns() /home/dpidatamanager/public_html/sites/all/modules/forena/renderers/FrxTable.inc:48

It appears as though the $xml argument for FrxRenderer->columns($xml, $path) is being passed as a DatabaseStatementBase object.

CommentFileSizeAuthor
#4 xpath_undefined.patch631 bytesmetzlerd
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

jamesdixon’s picture

Ah okay I know why it's happening anyways. It's because the data block had:

--INFO
return_type=raw

Maybe in this case we send a message saying something like "Don't add raw data blocks via the interface".

metzlerd’s picture

Shouldbe quite fixable, but i am away from my computer for several days. Will get to this upon my return

jamesdixon’s picture

Awesome, thank you!

metzlerd’s picture

Status: Needs work » Needs review
FileSize
631 bytes

Here's a patch that worked for me.

  • metzlerd committed 3a8cbc7 on 7.x-4.x
    #2285287 Call to undefined method DatabaseStatementBase::xpath()
    
metzlerd’s picture

Status: Needs review » Fixed
jamesdixon’s picture

Thanks this has fixed the issue on our end as well!

  • metzlerd committed 3a8cbc7 on 7.x-4.x-features
    #2285287 Call to undefined method DatabaseStatementBase::xpath()
    

Status: Fixed » Closed (fixed)

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