Getting Error "foo" from DOMPDF - php

I've got a script that produces several reports, each of which I've been converting to pdf using DOMPDF. The reports vary in size and type of content, but typically have a mix of images, tables, and stylized text.
On my latest report that I was trying to convert, I got the error below:
Exception information:
Message: foo
Stack trace:
#0 library/dompdf/include/table_row_frame_reflower.cls.php(83): Cellmap->get_frame_height(Object(Table_Row_Frame_Decorator))
#1 library/dompdf/include/frame_decorator.cls.php(477): Table_Row_Frame_Reflower->reflow(NULL)
#2 library/dompdf/include/table_frame_reflower.cls.php(481): Frame_Decorator->reflow()
#3 library/dompdf/include/frame_decorator.cls.php(477): Table_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#4 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#5 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#6 library/dompdf/include/inline_frame_reflower.cls.php(96): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#7 library/dompdf/include/frame_decorator.cls.php(477): Inline_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#8 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#9 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#10 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#11 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(Object(Block_Frame_Decorator))
#12 library/dompdf/include/block_frame_reflower.cls.php(706): Frame_Decorator->reflow(Object(Block_Frame_Decorator))
#13 library/dompdf/include/frame_decorator.cls.php(477): Block_Frame_Reflower->reflow(NULL)
#14 library/dompdf/include/page_frame_reflower.cls.php(169): Frame_Decorator->reflow()
#15 library/dompdf/include/frame_decorator.cls.php(477): Page_Frame_Reflower->reflow(NULL)
#16 library/dompdf/include/dompdf.cls.php(680): Frame_Decorator->reflow()
#17 application/controllers/NetworthController.php(332): DOMPDF->render()
#18 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Controller/Action.php(513): NetworthController->reportAction()
#19 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Controller/Dispatcher/Standard.php(295): Zend_Controller_Action->dispatch('reportAction')
#20 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#21 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Application/Bootstrap/Bootstrap.php(97): Zend_Controller_Front->dispatch()
#22 library/ZendFramework-1.11.0/ZendFramework-1.11.0/library/Zend/Application.php(366): Zend_Application_Bootstrap_Bootstrap->run()
#23 index.php(150): Zend_Application->run()
#24 {main}
I ran the html being input to DOMPDF through a validator, and there were no errors or warnings. The report does include several tables, but none of the tables would be forced to split over multiple pages (the longest table is about a third of a page). Other than invalid HTML, I'm not sure what can cause this, and searching for this error has indicated only that as a potential cause.
Suggestions?

I read this post https://groups.google.com/forum/?fromgroups#!topic/dompdf/yXDoankutY8 and went digging for HTML errors.
Check that both your CSS and HTML validates. I used the Tidy functions to fix my HTML and removed my CSS, re-implementing it bit by bit.
In my case it was a simple CSS rule:
.views-row {
display: block;
}

Related

Blank emails Can't retrieve entity config: admin/permission_block

I am getting blank shipment emails. If I remove the call to the track.phtml file from the email template the emails are otherwise okay. The track.phtml file and the email templates are default. I am getting an error in the exception log as below. Can anyone help please?
I am getting this error in the exception log
exception 'Mage_Core_Exception' with message 'Can't retrieve entity config: admin/permission_block' in /home/woods/public_html/app/Mage.php:595
Stack trace:
#0 /home/woods/public_html/includes/src/__default.php(30680): Mage::throwException('Can't retrieve ...')
#1 /home/woods/public_html/includes/src/__default.php(12396): Mage_Core_Model_Resource->getTableName('admin/permissio...')
#2 /home/woods/public_html/includes/src/__default.php(12359): Mage_Core_Model_Resource_Db_Abstract->getTable('permission_bloc...')
#3 /home/woods/public_html/includes/src/__default.php(32634): Mage_Core_Model_Resource_Db_Abstract->getMainTable()
#4 /home/woods/public_html/includes/src/__default.php(32671): Mage_Core_Model_Resource_Db_Collection_Abstract->getMainTable()
#5 /home/woods/public_html/includes/src/__default.php(32614): Mage_Core_Model_Resource_Db_Collection_Abstract->_initSelect()
#6 /home/woods/public_html/includes/src/__default.php(24498): Mage_Core_Model_Resource_Db_Collection_Abstract->__construct(Array)
#7 /home/woods/public_html/includes/src/__default.php(24530): Mage_Core_Model_Config->getModelInstance('admin_resource/...', Array)
#8 /home/woods/public_html/app/Mage.php(491): Mage_Core_Model_Config->getResourceModelInstance('admin/block_col...', Array)
#9 /home/woods/public_html/includes/src/Mage_Admin_Model_Block.php(79): Mage::getResourceModel('admin/block_col...')
#10 /home/woods/public_html/includes/src/__default.php(27659): Mage_Admin_Model_Block->isTypeAllowed('core/template')
#11 [internal function]: Mage_Core_Model_Email_Template_Filter->blockDirective(Array)
#12 /home/woods/public_html/includes/src/__default.php(27322): call_user_func(Array, Array)
#13 /home/woods/public_html/includes/src/__default.php(28041): Varien_Filter_Template->filter('{{template conf...')
#14 /home/woods/public_html/includes/src/Mage_Core_Model_Email_Template.php(311): Mage_Core_Model_Email_Template_Filter->filter('{{template conf...')
#15 /home/woods/public_html/includes/src/Mage_Core_Model_Email_Template.php(391): Mage_Core_Model_Email_Template->getProcessedTemplate(Array, true)
#16 /home/woods/public_html/includes/src/Mage_Core_Model_Email_Template.php(508): Mage_Core_Model_Email_Template->send(Array, Array, Array)
#17 /home/woods/public_html/includes/src/Mage_Core_Model_Email_Template_Mailer.php(84): Mage_Core_Model_Email_Template->sendTransactional('40', 'general', Array, Array, Array, '1')
#18 /home/woods/public_html/includes/src/Mage_Sales_Model_Order_Shipment.php(462): Mage_Core_Model_Email_Template_Mailer->send()
#19 /home/woods/public_html/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php(222): Mage_Sales_Model_Order_Shipment->sendEmail(true, '')
#20 /home/woods/public_html/includes/src/__default.php(14272): Mage_Adminhtml_Sales_Order_ShipmentController->saveAction()
#21 /home/woods/public_html/includes/src/__default.php(18736): Mage_Core_Controller_Varien_Action->dispatch('save')
#22 /home/woods/public_html/includes/src/__default.php(18266): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#23 /home/woods/public_html/includes/src/__default.php(21117): Mage_Core_Controller_Varien_Front->dispatch()
#24 /home/woods/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#25 /home/woods/public_html/index.php(83): Mage::run('', 'store')
#26 {main}
Error may be related to Block Permission issue. You need to allowed core/template block from backend.
For this follow the below steps:
Login in backend.
From Top Navigation got to System >> Permissions >> Blocks
here you need to add core/template block and set Is Allowed to Yes
I've answered a similar question here
I had this same problem, these steps solved it:
1- Make sure your tmp folder is writable, I had a custom tmp folder set on lib/Zend/Cache/Backend/File.php
'cache_dir' => 'tmp',
2- Remove var/cache and reload the admin page

Magento simplexml_load_string() error location

I have a really annoying problem. I was doing some alterations to Magento shop when I ran into simplexml_load_string() error, it is clear to me that this error is caused by some bad XML file, but the very important question to me is which file and where is it located?
This is the error message I receive, I was never very good at understanding these console type messages, can someone please help me?
Warning: simplexml_load_string(): Entity: line 1: parser error : StartTag: invalid element name in /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php on line 450
#0 [internal function]: mageCoreErrorHandler(2, 'simplexml_load_...', '/var/www/html/a...', 450, Array)
#1 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(450): simplexml_load_string('< ?xml version=...', 'Mage_Core_Model...')
#2 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(275): Mage_Core_Model_Layout_Update->getFileLayoutUpdatesXml('frontend', 'MyTheme', 'Responsive', '1')
#3 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(347): Mage_Core_Model_Layout_Update->fetchFileLayoutUpdates()
#4 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(246): Mage_Core_Model_Layout_Update->fetchPackageLayoutUpdates('default')
#5 /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php(224): Mage_Core_Model_Layout_Update->merge('default')
#6 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(306): Mage_Core_Model_Layout_Update->load()
#7 /var/www/html/app/code/core/Mage/Cms/Helper/Page.php(109): Mage_Core_Controller_Varien_Action->loadLayoutUpdates()
#8 /var/www/html/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'about-magento-d...')
#9 /var/www/html/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'about-magento-d...')
#10 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Cms_IndexController->indexAction()
#11 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(254): Mage_Core_Controller_Varien_Action->dispatch('index')
#12 /var/www/html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#13 /var/www/html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#14 /var/www/html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#15 /var/www/html/index.php(91): Mage::run('', 'store')
#16 {main}
It's something related with /var/www/html/app/code/core/Mage/Core/Model/Layout/Update.php so I would edit that file and I would go to the line 450.
Just before that line write:
Mage::log(print_r($filename, true));
Make sure that your logging is enabled and refresh the page. After that, take a look to var/log/system.log. The last xml is probably what you are searching for.

Socialengine addon Advanced Events Plugin v4.8.8p2 throwing errror on create

I've got a site set up with the base Socialengine setup going. I've installed most of the SocialEngineAddon suite of plugins, and for some reason, the Advanced Events plugin throws this error when I try and create one ie: example.com/appeals/create I've tried renaming back to the default site-event, but the problem persists, and I'm having trouble debugging this error. Has anyone seen an error like this before? (I'm quite new to Zend/SocialEngine)
exception 'Zend_Form_Exception' with message 'No view script registered with ViewScript decorator' in /home/activism/public_html/application/libraries/Zend/Form/Decorator/ViewScript.php:162
Stack trace:
#0 /home/activism/public_html/application/libraries/Zend/Form/DisplayGroup.php(920): Zend_Form_Decorator_ViewScript->render('')
#1 /home/activism/public_html/application/libraries/Zend/Form/Decorator/FormElements.php(116): Zend_Form_DisplayGroup->render()
#2 /home/activism/public_html/application/libraries/Zend/Form.php(2933): Zend_Form_Decorator_FormElements->render('')
#3 /home/activism/public_html/application/modules/Siteevent/views/scripts/index/create.tpl(294): Zend_Form->render(Object(Zend_View))
#4 /home/activism/public_html/application/libraries/Zend/View.php(108): include('/home/activism/...')
#5 /home/activism/public_html/application/libraries/Zend/View/Abstract.php(890): Zend_View->_run('/home/activism/...')
#6 /home/activism/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(900): Zend_View_Abstract->render('index/create.tp...')
#7 /home/activism/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(921): Zend_Controller_Action_Helper_ViewRenderer->renderScript('index/create.tp...', NULL)
#8 /home/activism/public_html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(960): Zend_Controller_Action_Helper_ViewRenderer->render()
#9 /home/activism/public_html/application/libraries/Zend/Controller/Action/HelperBroker.php(277): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#10 /home/activism/public_html/application/libraries/Zend/Controller/Action.php(527): Zend_Controller_Action_HelperBroker->notifyPostDispatch()
#11 /home/activism/public_html/application/libraries/Zend/Controller/Dispatcher/Standard.php(308): Zend_Controller_Action->dispatch('createAction')
#12 /home/activism/public_html/application/libraries/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#13 /home/activism/public_html/application/modules/Core/Bootstrap.php(83): Zend_Controller_Front->dispatch()
#14 /home/activism/public_html/application/libraries/Engine/Application.php(160): Core_Bootstrap->run()
#15 /home/activism/public_html/application/index.php(211): Engine_Application->run()
#16 /home/activism/public_html/index.php(24): include('/home/activism/...')
#17 {main}
Its seems you need to verify license .Contact the Socialengineaddson guys will help you.

Laravel exception from 3rd party library not showing stack trace

I am using the Bigcommerce PHP SDK within my Laravel 4 application. The Bigcommerce SDK is configured to throw exceptions when errors occur. These exceptions are usually of the class Bigcommerce\Api\ClientError. When these exceptions are thrown, instead of seeing a detailed output in my error logs like I normally do for Laravel exceptions (with stack traces, line numbers, file locations, etc), I only see a single line in the error log, something like this:
[2015-05-05 21:19:00] production.ERROR: Client Error (404): The requested resource was not found. [] []
Is there something I need to do within my app to ensure that these Bigcommerce exceptions are logged using the same detail as other Laravel exceptions?
Here's an example of the error output I'm used to seeing from Laravel. This output was the result of a Bigcommerce\Api\NetworkError. I do not understand why the output for this type of exception is what I'm looking for, but a Bigcommerce\Api\ClientError is not:
[2015-05-05 13:22:22] production.ERROR: exception 'Bigcommerce\Api\NetworkError' with message 'Empty reply from server' in /var/www/html/dev.example/vendor/bigcommerce/api/src/Bigcommerce/Api/Connection.php:213
Stack trace:
#0 /var/www/html/dev.example/vendor/bigcommerce/api/src/Bigcommerce/Api/Connection.php(326): Bigcommerce\Api\Connection->handleResponse()
#1 /var/www/html/dev.example/vendor/bigcommerce/api/src/Bigcommerce/Api/Client.php(225): Bigcommerce\Api\Connection->post('https://api.big...', Object(stdClass))
#2 /var/www/html/dev.example/vendor/bigcommerce/api/src/Bigcommerce/Api/Client.php(436): Bigcommerce\Api\Client::createResource('/products', Array)
#3 /var/www/html/dev.example/app/spire_models/Product.php(873): Bigcommerce\Api\Client::createProduct(Array)
#4 /var/www/html/dev.example/app/spire_models/Product.php(35): Spire_models\Product->pushToExternal()
#5 /var/www/html/dev.example/app/extensions/SlaveTrait.php(26): Spire_models\Product->additionalSyncWithMaster()
#6 /var/www/html/dev.example/app/controllers/ProductInfoController.php(225): Spire_models\Product->syncWithMaster()
#7 [internal function]: ProductInfoController->saveProductDetails()
#8 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(231): call_user_func_array(Array, Array)
#9 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(93): Illuminate\Routing\Controller->callAction('saveProductDeta...', Array)
#10 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(62): Illuminate\Routing\ControllerDispatcher->call(Object(ProductInfoController), Object(Illuminate\Routing\Route), 'saveProductDeta...')
#11 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Routing/Router.php(967): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request), 'ProductInfoCont...', 'saveProductDeta...')
#12 [internal function]: Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#13 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Routing/Route.php(109): call_user_func_array(Object(Closure), Array)
#14 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1033): Illuminate\Routing\Route->run(Object(Illuminate\Http\Request))
#15 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Routing/Router.php(1001): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#16 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(775): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#17 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(745): Illuminate\Foundation\Application->dispatch(Object(Illuminate\Http\Request))
#18 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Session/Middleware.php(72): Illuminate\Foundation\Application->handle(Object(Illuminate\Http\Request), 1, true)
#19 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Cookie/Queue.php(47): Illuminate\Session\Middleware->handle(Object(Illuminate\Http\Request), 1, true)
#20 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Cookie/Guard.php(51): Illuminate\Cookie\Queue->handle(Object(Illuminate\Http\Request), 1, true)
#21 /var/www/html/dev.example/vendor/stack/builder/src/Stack/StackedHttpKernel.php(23): Illuminate\Cookie\Guard->handle(Object(Illuminate\Http\Request), 1, true)
#22 /var/www/html/dev.example/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(641): Stack\StackedHttpKernel->handle(Object(Illuminate\Http\Request))
#23 /var/www/html/dev.example/public/index.php(49): Illuminate\Foundation\Application->run()
#24 {main} [] []
In the Bigcommerce/Api/ClientError.php theres one method __toString(). Comment it out.

SocialEngine4: Notification Error: Zend Engine_Api_Exception with message Unknown item type

I am using socialengine4 and my notifications keep giving me this error. I thought this was some type of config thing and look into the database or the notifications setting but i have not been able to fix this error. Can anyone point me in the right direction?
2012-05-22T17:40:21+00:00 CRIT (2):
Error Code: dc0cf5
exception 'Engine_Api_Exception' with message 'Unknown item type: news_content' in /var/www/html/application/libraries/Engine/Api.php:417
Stack trace:
#0 /var/www/html/application/libraries/Engine/Api.php(522): Engine_Api->getItemInfo('news_content', 'moduleInflected')
#1 /var/www/html/application/libraries/Engine/Api.php(330): Engine_Api->getItemApi('news_content')
#2 /var/www/html/application/modules/Activity/Model/Notification.php(80): Engine_Api->getItem('news_content', 2622)
#3 /var/www/html/application/modules/Activity/Model/Notification.php(49): Activity_Model_Notification->getObject()
#4 /var/www/html/application/modules/Activity/Model/Notification.php(98): Activity_Model_Notification->getContent()
#5 /var/www/html/application/modules/Activity/views/scripts/notifications/pulldown.tpl(17): Activity_Model_Notification->__toString()
#6 /var/www/html/application/libraries/Zend/View.php(108): include('/var/www/html/a...')
#7 /var/www/html/application/libraries/Zend/View/Abstract.php(835): Zend_View->_run('/var/www/html/a...')
#8 /var/www/html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(903): Zend_View_Abstract->render('notifications/p...')
#9 /var/www/html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(924): Zend_Controller_Action_Helper_ViewRenderer->renderScript('notifications/p...', NULL)
#10 /var/www/html/application/libraries/Zend/Controller/Action/Helper/ViewRenderer.php(964): Zend_Controller_Action_Helper_ViewRenderer->render()
#11 /var/www/html/application/modules/Activity/controllers/NotificationsController.php(109): Zend_Controller_Action_Helper_ViewRenderer->postDispatch()
#12 /var/www/html/application/libraries/Zend/Controller/Action.php(512): Activity_NotificationsController->pulldownAction()
#13 /var/www/html/application/libraries/Zend/Controller/Dispatcher/Standard.php(289): Zend_Controller_Action->dispatch('pulldownAction')
#14 /var/www/html/application/libraries/Zend/Controller/Front.php(946): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#15 /var/www/html/application/modules/Core/Bootstrap.php(75): Zend_Controller_Front->dispatch()
#16 /var/www/html/application/libraries/Engine/Application.php(160): Core_Bootstrap->run()
#17 /var/www/html/application/index.php(194): Engine_Application->run()
#18 /var/www/html/index.php(24): include('/var/www/html/a...')
#19 {main}
The settings for the items are in Application->modules->'modulename'->settings>manifest.php
There is an array called items which i added 'news_content' to and it worked.
I managed to fix it.
The problem was that somehow (despite lack of enable/disable link on the module box in the list of modules) it was disabled.
To enable it I accessed the 'engine4_core_modules' table, searched for 'storage' name and changed the 'enabled' cell content from 0 to 1.

Categories