Corrupt Drupal menu - drupal

Running Drupal 7.26 with nothing fancy and have started to encounter a corruption issue with the menu system. We started seeing the following error (truncated to fit). Doing a drush or a manual clear cache doesn't fix it, setting menu_router.weight to NULL yes, truncating both the menu_links and menu_router tables still produces the error. Links oddly menu still appear on the site, but only some not all.
I suspect that the issue might be caused by a page view (using views3) with a set path, but I can't see why that would be as it is again just a normal path.
PDOException: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: '' for column
'weight' at row 9: 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
.... (truncated) ....
(:db_insert_placeholder_184, :db_insert_placeholder_185, :db_insert_placeholder_186,
:db_insert_placeholder_187, :db_insert_placeholder_188, :db_insert_placeholder_189,
:db_insert_placeholder_190, :db_insert_placeholder_191, :db_insert_placeholder_192,
:db_insert_placeholder_193, :db_insert_placeholder_194, :db_insert_placeholder_195,
:db_insert_placeholder_196, :db_insert_placeholder_197,); Array (
.... (truncated) ....
[:db_insert_placeholder_180] => Ajax callback for view loading.
[:db_insert_placeholder_181] => [:db_insert_placeholder_182] => 0
[:db_insert_placeholder_183] => sites/all/modules/contrib/views/includes/ajax.inc
[:db_insert_placeholder_184] => volunteering/opportunities [:db_insert_placeholder_185] =>
[:db_insert_placeholder_186] => [:db_insert_placeholder_187] => ctools_access_menu
[:db_insert_placeholder_188] => a:1:{i:0;a:2:{s:4:"type";s:4:"none";s:8:"settings";N;}}
[:db_insert_placeholder_189] => page_manager_page_execute [:db_insert_placeholder_190] =>
a:1:{i:0;s:13:"volunteering_";} [:db_insert_placeholder_191] =>
[:db_insert_placeholder_192] => 3 [:db_insert_placeholder_193] => 2
[:db_insert_placeholder_194] => 0 [:db_insert_placeholder_195] =>
[:db_insert_placeholder_196] => volunteering/opportunities [:db_insert_placeholder_197] =>
Volunteering opportunities [:db_insert_placeholder_198] => t [:db_insert_placeholder_199]
=> [:db_insert_placeholder_200] => [:db_insert_placeholder_201] => a:0:{} ) in
_menu_router_save() (line 3837 of /var/mysite/dev/includes/menu.inc).

For some strange reason the function page_manager_list_page() in ctools page manager > page_manager.admin.inc wasn't setting a numeric weight. Not sure how or why it isn't checking it is not a an integer, but it doesn't which caused the issue.

Related

COMMERCE ORDER - PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when trying to get lock; try restarting transaction

Here is my error message
PDOException: SQLSTATE[40001]: Serialization failure: 1213 Deadlock found when
trying to get lock; try restarting transaction:
UPDATE {commerce_order} SET
order_number=:db_update_placeholder_0, revision_id=:db_update_placeholder_1,
type=:db_update_placeholder_2, uid=:db_update_placeholder_3,
mail=:db_update_placeholder_4, status=:db_update_placeholder_5,
created=:db_update_placeholder_6, changed=:db_update_placeholder_7,
placed=:db_update_placeholder_8, hostname=:db_update_placeholder_9,
data=:db_update_placeholder_10 WHERE (order_id = :db_condition_placeholder_0) ;
Array ( [:db_update_placeholder_0] => 201805822 [:db_update_placeholder_1] => 16807
[:db_update_placeholder_2] => commerce_order [:db_update_placeholder_3] => 0
[:db_update_placeholder_4] => [:db_update_placeholder_5] => checkout_checkout
[:db_update_placeholder_6] => 1540480400 [:db_update_placeholder_7] =>
1540481979 [:db_update_placeholder_8] => 0 [:db_update_placeholder_9] =>
128.199.161.50 [:db_update_placeholder_10] => a:4:
{s:17:"last_cart_refresh";i:1540481976;s:16:"shipping_service";s:17:"shipping_custom|1";s:14:"with_backorder";s:0:"";s:17:"backorder_service";s:5:"_none";}
[:db_condition_placeholder_0] => 5056 ) in drupal_write_record() (line 7387 of ~/public_html/includes/common.inc).
anyone can help me? whats wrong with that things?
The best fix is changing your transaction isolation level (to READ COMMITTED).
Try adding this to your settings.php. It's a common problem in high read/write Drupal sites with many fields.
$databases['default']['default']['init_commands'] = array(
'isolation' => "SET SESSION tx_isolation='READ-COMMITTED'"
);

Notice: Undefined property: DOMDocument::$documentElement

I recently re-opened an old (1 year) Symfony project and I am having an error on every page (I don't remember having this issue a year ago) :
[exception] 500 | Internal Server Error | Symfony\Component\Config\Exception\FileLoaderLoadException
/var/www/[...]/wdt.xml
ContextErrorException: Notice: Undefined property: DOMDocument::$documentElement
If I clear the cache, the error disappear but as soon as I edit and save a file, the error is showing up again.
The project was using Symfony 2.8 and I updated to Symfony 3.2 but it didn't solve the issue.
I don't think the problem is related to the wdt.xml file and I think it might be related to my laptop config.
I don't really know where to start to investigate so any suggestion is welcome!
Edit 1 :
I am actually having the same problem with another project I created few days ago. The project don't use any additional bundles and I just created 5 entities and generated the MySQL database.
Edit 2 :
After some more researched, I decided to create a new Ubuntu VM and test a new Symfony project and it just work perfectly so it must be something to do with the configuration on my laptop.
Edit 3 :
After some more tests, here is what I get when I add a print_r($dom); in the file XmlUtils.php (vendor/symfony/symfony/src/Symfony/Component/Config/Util/XmlUtils.php) line 59 :
Ubuntu VM (no error) :
DOMDocument Object ( [doctype] => [implementation] => (object value omitted) [documentElement] => (object value omitted) [actualEncoding] => [encoding] => [xmlEncoding] => [standalone] => 1 [xmlStandalone] => 1 [version] => 1.0 [xmlVersion] => 1.0 [strictErrorChecking] => 1 [documentURI] => /var/www/my_project/web/ [config] => [formatOutput] => [validateOnParse] => 1 [resolveExternals] => [preserveWhiteSpace] => 1 [recover] => [substituteEntities] => [nodeName] => #document [nodeValue] => [nodeType] => 9 [parentNode] => [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => [attributes] => [ownerDocument] => [namespaceURI] => [prefix] => [localName] => [baseURI] => /var/www/my_project/web/ [textContent] => %kernel.charset% %kernel.default_locale% )
Ubuntu laptop (error) :
DOMDocument Object ( [validateOnParse] => 1 [nodeName] => #document [nodeValue] => [nodeType] => 9 [parentNode] => [childNodes] => (object value omitted) [firstChild] => (object value omitted) [lastChild] => (object value omitted) [previousSibling] => [attributes] => [ownerDocument] => [namespaceURI] => [prefix] => [localName] => [baseURI] => /var/www/lab/symfony/booklib/web/ [textContent] => %kernel.charset% %kernel.default_locale% )
It looks like there is some missing information on my laptop...
So basically, the function $dom->loadXML doesn't return the same value on my laptop environment and inside the VM... any idea why?
I have Ubuntu 16.04 installation with php7.0.15, and i fixed the error by just removing php-xdebug extension.
sudo apt-get purge php-xdebug
I finally resolved the problem by uninstalling / reinstalling php7.
I have no idea why I had this issue though...
In my case the error was triggered by the dom.so extension being loaded in two places. Removing one fixed the problem.
This might be relevant:
https://getcomposer.org/doc/articles/troubleshooting.md#xdebug-impact-on-composer
TLDR: Use COMPOSER_ALLOW_XDEBUG=1 if you are using xdebug with composer.
This is very strange BUT try to change php extensions load order in php config. This solve my problem... move dom extension above or below in list
In my case the dom extension was enabled twice. Once in the dom.ini and also in the php.ini. I removed the extension=dom.so entry from the php.ini and reloaded the apache2 webserver.
Hi I also meet this problem. The way I resolve it is:
composer update
Hope that help some one.
Thank #pjehan. I had the same problem and I've lost a day. Finally, I did like you and it was successful.
Just specify one thing: unistall PHP 7.0.x and PHP 7.1.3 intaller (stable version for PHP 7). The link of the version PHP 7 stable: http://php.net/downloads.php
Thank you so much, #pjehan, you saved my life :D
I solved the problem by disabling xdebug for the cli

zend framework 2 notice appears in console when call a console action

I have follow the simple steps of zend documentation to develop a many simple console action.
My action have only one literal param. It works ok and the action is executed but before, in each call appears following notice and a stack trace.
How I do for remove / solve this message
Notice: Undefined index: HTTP_ACCEPT_LANGUAGE in C:\xampp\htdocs\pfc_desarrollo\module\SecureDraw\Module.php on line 124
Call Stack:
0.0003 121464 1. {main}() C:\xampp\htdocs\pfc_desarrollo\public\index.php:0
0.0079 237776 2. Zend\Mvc\Application::init() C:\xampp\htdocs\pfc_desarrollo\public\index.php:12
0.1589 1822568 3. Zend\Mvc\Application->bootstrap() C:\xampp\htdocs\pfc_desarrollo\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php:239
0.2135 2232464 4. Zend\EventManager\EventManager->trigger() C:\xampp\htdocs\pfc_desarrollo\vendor\zendframework\zendframework\library\Zend\Mvc\Application.php:142
0.2135 2232584 5. Zend\EventManager\EventManager->triggerListeners() C:\xampp\htdocs\pfc_desarrollo\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php:204
0.2350 2387304 6. call_user_func() C:\xampp\htdocs\pfc_desarrollo\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php:460
0.2350 2387320 7. SecureDraw\Module->onBootstrap() C:\xampp\htdocs\pfc_desarrollo\vendor\zendframework\zendframework\library\Zend\EventManager\EventManager.php:460
--------------------------------HELLOOOOOO------------------
This is my action / route definition
//module.php
'console' => array(
'router' => array(
'routes' => array(
'hello' => array(
'options' => array(
'route' => 'hello',
'defaults' => array(
'controller' => 'SecureDraw\Controller\Participant',
'action' => 'hello',
),
),
), //Line 124
),
),
),
//Participant.php
public function helloAction(){
return "--------------------------------HELLOOOOOO------------------";
}
You must be trying to access the Server Variable HTTP_ACCEPT_LANGUAGE inside your Module.php file.
$_SERVER['HTTP_ACCEPT_LANGUAGE'] is usally set using the Browser which has requested the page, but as your are running the app from the console it is probably not getting set.
You should check to see if it's set before accessing it.

Drupal Menu Throws SQL Error

I have this weird problem with Drupal Menus. When I try to add a link to any drupal menu, it throws the following SQL exception. I can create a new menu or delete an existing one, but I can't add any links :-) Any help?
Additional uncaught exception thrown while handling exception.
Original
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => tr [:source] => Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters. [:context] => ) in locale() (line 684 of /home/predra/public_html/modules/locale/locale.module).
Additional
PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) 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); Array ( [:db_insert_placeholder_0] => 1 [:db_insert_placeholder_1] => php [:db_insert_placeholder_2] => %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] => a:6:{s:5:"%type";s:12:"PDOException";s:8:"!message";s:495:"SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT s.lid, t.translation, s.version FROM {locales_source} s LEFT JOIN {locales_target} t ON s.lid = t.lid AND t.language = :language WHERE s.source = :source AND s.context = :context AND s.textgroup = 'default'; Array ( [:language] => tr [:source] => Configure how content input by users is filtered, including allowed HTML tags. Also allows enabling of module-provided filters. [:context] => ) ";s:9:"%function";s:8:"locale()";s:5:"%file";s:53:"/home/predra/public_html/modules/locale/locale.module";s:5:"%line";i:684;s:14:"severity_level";i:3;} [:db_insert_placeholder_4] => 3 [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => http://predra.com/admin/structure/menu/manage/menu-header-menu/add [:db_insert_placeholder_7] => http://predra.com/doktor/haldun-san [:db_insert_placeholder_8] => 78.180.179.155 [:db_insert_placeholder_9] => 1348828684 ) in dblog_watchdog() (line 154 of /home/predra/public_html/modules/dblog/dblog.module).
Please change max_allowed_packet to 20M or more in mysql\bin\my.ini (depends on your mysql server config path.)
It works!

Decrypting Drupal / Ubercart Credit Card Info Externally

Right now I have a simple PHP script outside of my drupal installation that just compiles a CSV for my client of orders and the credit card type (Visa, Mastercard..)
It seems like an older version of Drupal 6 just had this part of data serialized in the database "cc_card" however now it seems to be encrypted.
Is there a way to decrypt this data (Stored in us_orders.data) so that I could see the card type?
The uc_credit_cache() function should do what you want:
$order = uc_order_load($order_id);
$cc_data = uc_credit_cache('save', $order->data['cc_data'], TRUE);
$cc_data should look something like this:
Array
(
[cc_type] => visa
[cc_owner] =>
[cc_number] => 4111111111111111
[cc_start_month] =>
[cc_start_year] =>
[cc_exp_month] => 9
[cc_exp_year] => 2012
[cc_issue] =>
[cc_cvv] => 222
[cc_bank] =>
)

Resources