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

Comments

thomjjames’s picture

Status: Active » Needs review
StatusFileSize
new1.21 KB

and here's a patch.

Tom

thomjjames’s picture

Priority: Normal » Critical
Tauran’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Status: Needs review » Fixed

Hi thomjjames,

thanks for the patch, but I fixed it differently.

Status: Fixed » Closed (fixed)

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