我有一个Drupal 7站点,我很难找到解决以下问题的方法.
我的所有cron任务都运行良好,但搜索索引cron.它会在日志中生成此错误并停止索引.看起来它与entity_extract_ids()field.multilingual.inc中的函数有关,但我不知道从哪里开始.这是错误日志:
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}
Run Code Online (Sandbox Code Playgroud)
任何帮助或见解将不胜感激.
我会告诉你我是如何修理它的.
我得到了EntityMalformedException:在尝试索引搜索之后,在我的watchlog中的类型node error的实体上缺少bundle属性(最近的日志消息)(所以在cron运行之后).在我的指数让我们说48%之前,在cron运行之后它保持不变.
我做了很多事情,其他建议对我没有帮助,但最后我做了这个并建议你:
对我来说,我做了7-8次从数据库中删除所有"坏"节点,最后得到100%索引
如果您无法访问phpMyAdmin,我猜您可以这样做:
例如,打开PHP过滤器模块和备份数据库创建节点类型的页面,以添加代码
<?php
$result = db_query_range("SELECT n.nid FROM {node} n LEFT JOIN {search_dataset} d ON d.type = 'node' AND d.sid = n.nid WHERE d.sid IS NULL OR d.reindex <> 0 ORDER BY d.reindex ASC, n.nid ASC", 0, 1);
echo $result;
?>
Run Code Online (Sandbox Code Playgroud)
当然选择"PHP过滤器"
单击"预览"您应该在屏幕上看到节点ID.测试就像在phpMyAdmin的方向的第6步,并记住现在你可以删除它添加到正文
<?php
$nid = "your-nid";
db_delete('node')
->condition('nid', $nid)
->execute();
?>
Run Code Online (Sandbox Code Playgroud)
再次单击预览再次运行Cron
上面的代码我没有测试,所以如果你使用它,请在这里发布,如果它的工作原理
谢谢你,快乐索引;)