Hi,
THE ISSUE
When using the "Node adding form" with node type that contains a CCK field that has "Number of values" set to unlimited and therefore displays a "add more items" button I get an Ajax pop up error (see screengrab) and the following error when the page is refreshed:
* warning: pageroute_page::include_once(/.page_.inc) [function.pageroute-page-include-once]: failed to open stream: No such file or directory in E:\localhost\testing\acquia\sites\all\modules\pageroute\pageroute.page.inc on line 62.
* warning: pageroute_page::include_once() [function.include]: Failed opening '/.page_.inc' for inclusion (include_path='.;C:\php5\pear') in E:\localhost\testing\acquia\sites\all\modules\pageroute\pageroute.page.inc on line 62.
THE SOLUTION
Adding an if statement to the get_object function in the pageroute.page.inc file seems to fix it.
public static function get_object($page_data) {
$type = $page_data->type;
if ($page_data) {
$bases = pageroute_get_types('base');
// Include needed type!
include_once(drupal_get_path('module', $page_data->module) .'/'. $page_data->module .'.page_'. $page_data->type .'.inc');
$page_class = $page_data->module .'_page_'. $page_data->type;
$page = new $page_class($page_data);
$page->set_up();
return $page;
}
}
I don't understand the full workings of the module and i'm not great with OOP, so this may not be the best fix?
I will submit a patch ASAP.
Thanks for this great module & API
Tom
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | pageroute.page_.inc_.patch | 1.21 KB | thomjjames |
| pageroute_error.jpg | 404.85 KB | thomjjames |
Comments
Comment #1
thomjjames commentedand here's a patch.
Tom
Comment #2
thomjjames commentedComment #3
Tauran commentedHi thomjjames,
thanks for the patch, but I fixed it differently.