我刚刚将更新测试为8.7.1 (从8.6.x开始),其中包括删除旧的自动实体更新功能,这意味着drush entup不再工作。就我所理解的变更记录而言,开发人员现在需要在更新钩子中执行更新。但是,在使用composer更新核心并执行数据库更新(运行时没有任何错误)之后,我在状态报告中得到警告:
在实体类型和字段定义中检测到以下更改。 taxonomy_term实体类型:需要安装缓和状态字段。
但是没有钻孔entity-update,我不知道我应该在这里做什么。如何执行更新?Drush dbup成功运行(现在没有任何未完成的更新),drush entup不再工作了。如何处理此错误?
作为记录,这是第一个drush updb的输出,不确定它是否相关:
server:~/httpdocs$ drush updb
------------------- ----------------------------------------------- --------------- -----------------------------------------------------------------------------
Module Update ID Type Description
------------------- ----------------------------------------------- --------------- -----------------------------------------------------------------------------
system 8701 hook_update_n Remove the unused 'system.theme.data' from state.
system 8702 hook_update_n Add the 'revision_translation_affected' entity key.
file 8700 hook_update_n Set the 'owner' entity key and update the field.
node 8700 hook_update_n Set the 'owner' entity key and update the field.
taxonomy 8701 hook_update_n Add an index on the 'taxonomy_term__parent' field table.
menu_link_content make_menu_link_content_revisionable post-update Update custom menu links to be revisionable.
system add_expand_all_items_key_in_system_menu_block post-update Initialize 'expand_all_items' values to system_menu_block.
system clear_menu_cache post-update Clear the menu cache. @see https:www.drupal.orgprojectdrupalissues3044364
system fix_jquery_extend post-update Clear the library cache and ensure aggregate files are regenerated.
taxonomy make_taxonomy_term_revisionable post-update Update taxonomy terms to be revisionable.
taxonomy remove_hierarchy_from_vocabularies post-update Remove the 'hierarchy' property from vocabularies.
views exposed_filter_blocks_label_display post-update Update exposed filter blocks label display to be disabled.
views make_placeholders_translatable post-update Rebuild cache to allow placeholder texts to be translatable.
------------------- ----------------------------------------------- --------------- -----------------------------------------------------------------------------
Do you wish to run the specified pending updates? (yes/no) [yes]:
> yes
[notice] Update started: system_update_8701
[ok] Update completed: system_update_8701
[notice] Update started: system_update_8702
[ok] Update completed: system_update_8702
[notice] Update started: file_update_8700
[ok] Update completed: file_update_8700
[notice] Update started: node_update_8700
[ok] Update completed: node_update_8700
[notice] Update started: taxonomy_update_8701
[ok] Update completed: taxonomy_update_8701
[notice] Update started: menu_link_content_post_update_make_menu_link_content_revisionable
[notice] Custom menu links have been converted to be revisionable.
[ok] Update completed: menu_link_content_post_update_make_menu_link_content_revisionable
[notice] Update started: system_post_update_add_expand_all_items_key_in_system_menu_block
[ok] Update completed: system_post_update_add_expand_all_items_key_in_system_menu_block
[notice] Update started: system_post_update_add_expand_all_items_key_in_system_menu_block
[ok] Update completed: system_post_update_add_expand_all_items_key_in_system_menu_block
[notice] Update started: system_post_update_clear_menu_cache
[ok] Update completed: system_post_update_clear_menu_cache
[notice] Update started: system_post_update_fix_jquery_extend
[ok] Update completed: system_post_update_fix_jquery_extend
[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Taxonomy terms have been converted to be revisionable.
[ok] Update completed: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Taxonomy terms have been converted to be revisionable.
[ok] Update completed: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Taxonomy terms have been converted to be revisionable.
[ok] Update completed: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Taxonomy terms have been converted to be revisionable.
[ok] Update completed: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Taxonomy terms have been converted to be revisionable.
[ok] Update completed: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Update started: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Taxonomy terms have been converted to be revisionable.
[ok] Update completed: taxonomy_post_update_make_taxonomy_term_revisionable
[notice] Update started: taxonomy_post_update_remove_hierarchy_from_vocabularies
[ok] Update completed: taxonomy_post_update_remove_hierarchy_from_vocabularies
[notice] Update started: views_post_update_exposed_filter_blocks_label_display
[ok] Update completed: views_post_update_exposed_filter_blocks_label_display
[notice] Update started: views_post_update_exposed_filter_blocks_label_display
[ok] Update completed: views_post_update_exposed_filter_blocks_label_display
[notice] Update started: views_post_update_make_placeholders_translatable
[ok] Update completed: views_post_update_make_placeholders_translatable
[success] Finished performing updates.发布于 2019-05-16 13:48:40
一种选择是使用新的开发实体更新模块,该模块正是为此目的构建的:
在#2976035:实体类型CRUD操作必须使用上次安装的实体类型和字段存储定义中,删除了运行钻取包的能力,有关详细信息,请参阅相关变更记录。该项目旨在将此功能恢复为开发人员专用工具。该模块依赖于发展,不打算在生产环境中启用或在部署工作流中使用。
发布于 2019-07-25 09:56:25
再次将其放入更新钩子中。将其放入your_module_name.install文件中。(安装时确保它已经存在于模块中,否则将其放入其他模块安装文件中)
/**
* Update- Create your_entity_name entity.
*/
function your_module_name_update_8002() {
//check if the table exists first. If not, then create the entity.
if(!db_table_exists('your_entity_name')) {
\Drupal::entityTypeManager()->clearCachedDefinitions();
\Drupal::entityDefinitionUpdateManager()
->installEntityType(\Drupal::entityTypeManager()->getDefinition('your_entity_name'));
}
else {
return 'your_entity_name entity already exists';
}
}发布于 2019-09-20 08:45:16
正如@MoritzLost所指出的,依赖drush entup是一种解决办法。正确的解决方案是依赖WBM修补程序,或者在更新到8.7之前等待其发布。更多细节可在https://www.drupal.org/project/devel_实体_最新情况/问题/3082442获得。
https://drupal.stackexchange.com/questions/281223
复制相似问题