Hi i am using drupal 7 i get this strange issue
Notice: unserialize(): Error at offset 104 of 110 bytes in _menu_link_translate() (line 882 of path_to_mysite\includes\menu.inc).
Following function shows line number 882
function _menu_link_translate(&$item, $translate = FALSE) {
if (!is_array($item['options'])) {
$item['options'] = unserialize($item['options']);//**this is line number 882**
}
if ($item['external']) {
$item['access'] = 1;
$map = array();
$item['href'] = $item['link_path'];
$item['title'] = $item['link_title'];
$item['localized_options'] = $item['options'];
}
I have already installed Variable Check Module and it's clear of any error. I also tried following query, but its empty please guide me here.
SELECT name, LENGTH( value ) , value
FROM variable
WHERE LENGTH( value ) = 882
This means that the link in question is corrupted. Some function, process or arbitrary query has altered the link in the database so that the serialized data is not the expected length.
When you serialize data, you are generally storing an array or object in one single field. This might look something like this:
a:1:{s:10:"attributes";a:1:{s:5:"title";s:33:"Select and configure your themes.";}}
What this means is:
- Array with 1 element, which contains:
-- A string that is 10 characters long (attributes) (this is the element key)
-- An array with 1 element (this is the first Array's value), which contains:
--- A string that is 5 characters long (title) (this is the second Array's element key)
--- A string that is 33 characters long (Select and configure your themes.) (This is the second Array's element value)
In this example, if you went directly into your database and manually changed the word "attributes" to be "llama", but you DIDN'T change the "s:10" just before it to "s:5", you would get an unserialize error similar to the one you are receiving.
To fix this issue, you need to first track down which link specifically is causing the issue. You can do this with dpm() (as Stanislav mentions above). You can also query your menu_links table directly and scour the options column for any links that have a mismatch between string length and the number that describes the string length. You can also just start deleting suspicious links and re-adding them (though this may not be practical on a production or large site).
There are more complex methods of sussing out the bad links, but these in my experience are the best methods (in that order).
Good luck!