Jump to:
| Project: | Panels |
| Version: | 7.x-3.3 |
| Component: | Panel pages |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed (duplicate) |
Issue Summary
I have a very simple website. I created three custom pages based using basic pages as input and then a menu item as a tab. The first two pages -- a front page and an about us -- works fine. Tabs appear as they should and all paths appear. I then attempted to create the third page, and instead of enabling the menu within the custom page, I did the following:
1. I created the menu 'Work' using Structure --> Menus and linked using my basic page path.
2. Created the custom page, added a menu (the same menu as I created), and a new path, (to be changed after completion),
3. used a single column panel layout, and imported the basic page.
4. I saved the custom page, and clicked on the path in the summary and the page is not found.
This error also appears in the log. I can no longer create any custom pages, even after uninstalling and reinstalling. It should be noted that I can link to my basic page with a menu, just not a custom page. This issue may be related to this, which I found in the drupal core issue database, and seems very similar:
http://drupal.org/node/1267278
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column 'weight' at row 8: INSERT INTO {menu_router} (path, load_functions, to_arg_functions, access_callback, access_arguments, page_callback, page_arguments, delivery_callback, fit, number_parts, context, tab_parent, tab_root, title, title_callback, title_arguments, theme_callback, theme_arguments, type, description, position, weight, include_file) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22), (:db_insert_placeholder_23, :db_insert_placeholder_24, :db_insert_placeholder_25, :db_insert_placeholder_26, :db_insert_placeholder_27, :db_insert_placeholder_28, :db_insert_placeholder_29,
....and this at the end:
[:db_insert_placeholder_456] => [:db_insert_placeholder_457] => [:db_insert_placeholder_458] => 0 [:db_insert_placeholder_459] => modules/taxonomy/taxonomy.pages.inc ) in _menu_router_save() (line 3828 of /Library/WebServer/Documents/summatrix/includes/menu.inc).
Comments
#1
Merlin,
Here's an export of one of my pages. It looks like the menu weight was not initialized and may have caused this error. We were able to add an integer in there and it seemed to work fine. I still don't know why I was able to create two custom pages OK and not a third?
$page = new stdClass();
$page->disabled = FALSE; /* Edit this to true to make a default page disabled initially */
$page->api_version = 1;
$page->name = 'about_us';
$page->task = 'page';
$page->admin_title = 'about us';
$page->admin_description = 'Descriptions of Chris and I. ';
$page->path = 'aboutus';
$page->access = array();
$page->menu = array(
'type' => 'tab',
'title' => 'About Us',
'name' => 'navigation',
'weight' => '',
'parent' => array(
'type' => 'none',
'title' => '',
'name' => 'navigation',
'weight' => '0',
),
);
$page->arguments = array();
$page->conf = array(
'admin_paths' => FALSE,
);
...more
#2
It's not clear that Panels (or more accurately, Page Manager, which is what you're using) is what caused your corrupt database; and in fact it seems relatively unlikely to have done so.
Your database definitely has some serious issues. It's hard to tell, from here, what those might be. You might check your mysql log and see if it gives any hints. A repair tables on the menu_router table might do something.
#3
If my database had a problem, why then, would an export from what is it called? Page manager? or Panels or both (one can't tell what it is based on the weak UI) show missing a menu weight integer? and thereby cause a complete panel/page creation error?
The problem can worked around by: uninstalling and reinstalling the panels module, importing your pages, and then adding an integer to the missing weight in the import file (as per above). I believe this problem only happens when you use the page manager to create a menu item.
#4
Well, if the weight really is the problem, then going into the settings and setting the weight to an integer value should fix the problem.
It's odd, though, because I've never run into this problem. It's possible that it's PHP version dependent or something, where other versions of PHP are more forgiving about turning a string '' into a 0 (which is very very common in PHP, so we generally expect it will happen when it is supposed to).
#5
It may in fact be a Drupal Core issue. Have a look at this open bug in the core that couldn't be reproduced and is still open:
http://drupal.org/node/1267278
Yes, could be the version of PHP. My local machine is using 5.2.17
thanks for your help. Will let you know if I run into this on my server as well, which has PHP 5.3 installed.
#6
Marking NMI -- if you get more information on this, please feel free to re-open and we can investigate further. Until then we will wait.
#7
Going to assume this is the core problem until shown otherwise.