Closed (outdated)
Project:
Drupal core
Version:
7.x-dev
Component:
menu system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2011 at 11:50 UTC
Updated:
29 Apr 2017 at 13:06 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
magda_ commentedI get the same log message. ?
Comment #2
bfroehle commentedWhat is the text of the actual exception? That will be useful for debugging.
Comment #3
hakankahraman66 commentedIt is the only message that returns.
I checked to learn when it occurs and found that it occurs after "site entry, every node entry and return back from any node."
Comment #4
jordiserra commentedI am getting the same message "PDOException: in _menu_router_save() (line 3703 of..." but in different line. this line is
$insert->execute();
So it seems to be a problem when drupal saves something in database, maybe the database is corrupted in some way?
Thanks!
Comment #5
Arnion commentedIn my case: "PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'description' cannot be null: INSERT INTO {menu_router} ... ... in _menu_router_save() (line 3768 of /www/includes/menu.inc)."
Comment #6
Anonymous (not verified) commentedHere is my log in Drupal 7.12:
Emplacement http://toto.com/admin/structure/data/create
Référent http://toto.com/admin/structure/data/create
Message PDOException : dans _menu_router_save() (ligne 3811 dans /var/www/toto.com/includes/menu.inc).
Comment #7
jisuo commentedGet the same in 7.14
PDOException: in _menu_router_save() (row 3813 of /var/www/drupal/example.com/public_html/includes/menu.inc).
Comment #8
julien commentedFound the same bug too, but for me it was because a path was declared in a custom module hook_menu which was a drupal core path, and as the path column in the menu_router table is as primary key, i was getting a pdo exeption.
Comment #9
ravi.kumar commentedHi All,
I found the same issue when i give a special character (Búsqueda de Distribuidores) in menu title.
After removing special character the issue was solved for me.
Thanks
Ravi Kumar
Comment #10
evets33 commentedHello
I have this message in report journal :
PDOException : dans _menu_router_save() (ligne 3768 dans /.../includes/menu.inc).
I don't have special character. I don't know how can i identify my problem ?
Thank you for your help !
Comment #11
dpovshed commentedHow it is going with the issue? Wasn't it gone away for you, people, if you:
1) update Drupal to recent version;
and
2) ensure that your Drupal database, at least all system tables, is in UTF8 format?
Comment #12
1420MHz commentedI get the same error after updating my local drupal from 7.10 to 7.19 and then to 7.21. With 7.10 everything worked well. After updating to 7.19 the following error started to appear in my log:
Typ Menü
Datum Mittwoch, März 20, 2013 - 00:21
Benutzer admin
Standort http://localhost/(domainName)/www/admin/reports/dblog
Referrer http://localhost/(domainName)/www/admin/reports
Nachricht PDOException: in _menu_router_save() (Zeile 3828 von C:\xampp\htdocs\(domainName)\www\includes\menu.inc).
Schweregrad Fehler
Hostname ::1
Operationen
The error was not fixed by updating from 7.19 to 7.21. It seems to be triggered by simply using the administration menu. When I click some links in the administration menu and go back to the error log, the error message has been repeated.
There is another problem with my drupal that appeared with the update to 7.19, and it is possibly correlated with the error message: The administration menu seems to have update problems. When I add a new content type, I can see it in admin/structure/types. However, it is not listed in node/add. Also, the configuration menu of a module (Availability Calendars) I installed before updating does not show up, when I click on the corresponding link.
Here are lines 3825 - 3830 of menu.inc:
This part belongs to _menu_router_save($menu, $masks) which "saves data from menu_router_build() to the router table." according to a comment in the code.
I checked my database tables: They are all set to utf8_general_ci
The last thing I did before updating Drupal was installing the Availability Calendars module. (It requires drupal core >= 7.14, which is why I did the update.)
There are no uncommon characters (like ú, see post #9) in my menu names. However, I do use german Umlauts like ä,ö,ü and perhaps also the ß.
Somehow, I belive that my database is corrupted. But I can't figure out, what went wrong.
Does anyone have an idea of how this problem could be fixed?
Comment #13
dpovshed commentedThank you 1240MHz for detailed description!
However one of the most important part about error Exception is the text of the Exception message. normally you can view it when you click on log message for details.
Now I can only assume what exactly kind of error you have. I expect this is the same as referred in comment #5 , then the attached patch may help you.
Please try to apply it on 7.21 and let us know.
Comment #14
roman_pro commentedfound solution here:
http://drupal.org/node/1294432
Comment #15
jjchinquistHere is the SQL Exception:
I output the database PDO object to the screen to see which menu router items had a blank title attribute using this code:
The relevant output of the PDO object looks like the following (see delta #13 in both sub-arrays):
In the /modules/system/system.install file, the schema for the menu_router table says that title can not be NULL, but can be an empty string. A work around would be to default any NULL title to an empty string as follows (patch coming soon so we can test and see if it works):
Line 3814 original
Line 3814 edited
Any feedback of integrity in the system due to this change would be welcome!
Comment #16
jjchinquistChanging this to a bug report and 7.x-dev.
I am not certain if the integrity checks should be a part of the contributed module and not a part of core, but hopefully this will do the trick.
Comment #18
tigertrussell commentedI have this same error and it's plaguing me! My site is CRAWLING because the menu never gets rebuilt, and it therefore never changes the "menu_rebuild_needed" variable to false. So it rebuilds EVERY TIME.
I don't understand this patch, either... from my debugging steps, $items['title'] is not ever null -- it's just empty. And an empty string like that returns TRUE to empty(), as well!
Has anyone found a real solution / the real cause of this yet?
Comment #19
jjchinquistHi, empty() did the trick for me. But research the opposites:
if (!isset(...)) 1 otherwise 2
or reverse the check
if (!empty()) ... 2 otherwise 1
I can only say that I will look to add a patch again later today, but if none of the values are NULL or empty, then you have a different issue.
Comment #20
tigertrussell commentedI applied your patch but found there was one other area where a link_title entry needed to be edited. Now my site works fine -- I just feel like there's an underlying cause that we are not addressing with these particular patches.
Comment #21
jjchinquistThat I agree with. I did not at the time though go through the backtrace to find where the issue could be coming from. Can you post the backtrace and we can take a look. Can you also post a patch because you said that you had to change "link_title" in a different area. Maybe then we can at least get that patch into core.
Comment #22
maestrojed commentedI had this issue. I understood that the title can't be null but I couldn't figure out what the problem module/theme/whatever was. This is a tip on identifying the problem.
It is not a patch or fix. This certainly should not be add to a production site or left in the code.
This also requires the devel module since I use dpm(). You could adjust to report this debug code in some other manor.
Around Line 3798 Find the start of this foreach loop
foreach ($menu as $path => $item) {and append it so it ends up like this
This will give you a obj print out of the problem child and you should be able to identify it. Mostly likely you have a problematic module or theme.info file.
Comment #23
xaooosss commented$insert->execute(); dont work
Comment #24
xaooosss commented16: PDO-menu-router-item-null-value-exception-1118028-16.patch queued for re-testing.
Comment #25
Anonymous (not verified) commentedThe null title could be generated by a synthax error in an .info file (module or theme).
Drupal doesn't check the file synthax, so the module or theme is enabled but with a corrupt data structure.
For example if you theme info file begin with
wil generate an theme object with
Comment #26
malcomio commentedThis is very similar to #619542: Malformed theme .info files break menu_router generation and #2329453: Ignore front end vendor folders to improve directory search performance, where NPM or bower components in a theme file were causing problems.
The patch at #2329453-8: Ignore front end vendor folders to improve directory search performance fixed the issue for me.
Comment #27
cubeinspire commentedIn my case the error was produced by a special character on a programmatically created menu item's label.
After adding this function on a custom module and cleared the cache the error mentioned appeared.
I edited with nano the file and seen a broken special character, deleting the character, (it was on the ú inside the label), saving the file and clearing the cache solved the issue.