I have a Drupal 7 site and I’m struggling to find a solution to the following problem.
I have all my cron tasks are running fine but the search indexing cron. It produces this error in the logs and stops from indexing. It looks like it has something to do with the entity_extract_ids() function in field.multilingual.inc, but I have no clue where to start on this. Here is the error log:
exception 'EntityMalformedException' with message 'Missing bundle property on entity of type node.' in /home/xxxxx/public_html/includes/common.inc:7562
Stack trace:
#0 /home/xxxxx/public_html/modules/field/field.multilingual.inc(268): entity_extract_ids('node', Object(stdClass))
#1 /home/xxxxx/public_html/modules/field/field.attach.inc(1111): field_language('node', Object(stdClass), NULL, 'en')
#2 /home/xxxxx/public_html/modules/node/node.module(1358): field_attach_prepare_view('node', Array, 'search_index', 'en')
#3 /home/xxxxx/public_html/modules/node/node.module(1284): node_build_content(false, 'search_index', 'en')
#4 /home/xxxxx/public_html/modules/node/node.module(2668): node_view(false, 'search_index')
#5 /home/xxxxx/public_html/modules/node/node.module(2650): _node_index_node(Object(stdClass))
#6 [internal function]: node_update_index()
#7 /home/xxxxx/public_html/includes/module.inc(826): call_user_func_array('node_update_ind...', Array)
#8 /home/xxxxx/public_html/modules/search/search.module(363): module_invoke('node', 'update_index')
#9 [internal function]: search_cron()
#10 /home/xxxxx/public_html/sites/all/modules/ultimate_cron/ultimate_cron.module(726): call_user_func('search_cron')
#11 [internal function]: _ultimate_cron_run_hook('search_cron', Array)
#12 /home/xxxxx/public_html/sites/all/modules/background_process/background_process.module(428): call_user_func_array('_ultimate_cron_...', Array)
#13 [internal function]: background_process_service_start('ultimate_cron%3...')
#14 /home/xxxxx/public_html/includes/menu.inc(516): call_user_func_array('background_proc...', Array) #15 /home/xxxxx/public_html/index.php(21): menu_execute_active_handler()
#16 {main}
Any help or insight would be greatly appreciated.
I’ll tell you how I fixed it.
I got EntityMalformedException: Missing bundle property on entity of type node error in my watchlog (recent log messages) after trying to index search (so after cron run). Before my index was let’s say 48%, after cron run it stayed same.
I did lots of things, other suggestions didn’t help me, but finally I did this and suggest you too:
if you have table prefix, don’t forget to put it here.
AS for me I did this 7-8 times to delete all “bad” nodes from database and finally get 100% index
if you don’t have access to phpMyAdmin I guess you can do this:
Turn on PHP filter module and backup database
create node type of page for example, to body add code
choose “PHP Filter” of course
Click “Preview”
You should see node id on the screen. Test it like in step 6 of directions for phpMyAdmin and pick in mind
Now you can delete it with adding to the body
Click Preview again
Run Cron again
Code above I didn’t test, so if you’ll use it please post here if it works
Thank you and happy indexing 😉