drupal 7安装entityreference_prepopulate 模块后出再现代码
错误截图:
错误代码
Deprecated function: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in include_once() (line 1387 of /var/www/html/includes/bootstrap.inc).
Deprecated function: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in include_once() (line 1387 of /var/www/html/includes/bootstrap.inc).
Notice: Undefined index: normal 在 flag_flag->get_link_type() (行 1214 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
Notice: Trying to access array offset on value of type null 在 flag_flag->options() (行 203 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
Warning: array_merge(): Expected parameter 2 to be an array, null given 在 flag_flag->options() (行 203 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
Warning: Invalid argument supplied for foreach() 在 flag_flag->construct() (行 222 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
Notice: Undefined index: normal 在 flag_flag->get_link_type() (行 1214 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
Notice: Trying to access array offset on value of type null 在 flag_flag->options() (行 203 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
Warning: array_merge(): Expected parameter 2 to be an array, null given 在 flag_flag->options() (行 203 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
Error: Unsupported operand types 在 flag_flag::factory_by_row() (行 132 在 /var/www/html/sites/all/modules/flag/includes/flag/flag_flag.inc).
解决办法:
根据drupal 官方列出的补丁修改就好!
补丁下载:https://www.drupal.org/project/entityreference_prepopulate/issues/3115641
修改方法:打开终端,进入entityreference_prepopulate 目录
cd /var/www/html/sites/all/modules/entityreference_prepopulate
修改entityreference_prepopulate.module文件
vim entityreference_prepopulate.module
把336行
if (!$form_build_id = isset($_GET['form_build_id']) ? $_GET['form_build_id'] : isset($_POST['form_build_id']) ? $_POST['form_build_id'] : NULL) {
修改为:if (!$form_build_id = (isset($_GET['form_build_id']) ? $_GET['form_build_id '] : isset($_POST['form_build_id'])) ? $_POST['form_build_id'] : NULL) {
wq 保存即可!!