I ported the Similar by Terms (similarterms) module from Drupal 7 to Backdrop a couple of years ago. The similarterms.install file basically just has a todo note in it and I don't really know how to create the contents of this file. When I did the Backdrop core update there's a pending update for similarterms which just references this file and running the update script doesn't do anything.
6200 - @file Install, update and uninstall functions for the similarterms module.
Is there an easy way to create the .install file for this module?
The similarterms module otherwise works great.
Comments
I should have mentioned that the todo note says: // TODO The old hook_update_N functions cannot be applied to Backdrop.
There has just been another update to fix this issue.
You can safely delete that function if it does nothing. Things that normally go in an install file:
hook_schema
- define database table(s)hook_install
,hook_uninstall
,hook_enable
,hook_disable
hook_update_N
,hook_update_last_removed
hook_requirements
If you are providing an upgrade path from Drupal 7 then you likely need a
hook_update_1000
implementation. See https://docs.backdropcms.org/converting-modules-from-drupal#create-upgra...Many module do not need an
.install
file.Thanks for the quick and helpful reply. Through some more testing, I realize that similarterms is displaying in the views where I have it, but I can't make edits as there is an error when I try to edit the contextual filter in the view.
Error
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'backdrop.taxonomy_vocabulary' doesn't exist: SELECT vid, machine_name,name FROM {taxonomy_vocabulary} ORDER BY weight; Array ( )
The module probably needs further updates.
I notice you've never created a release for the module so it can be visible on backdropcms.org and installed from within other Backdrop sites. Is there a reason for that?
I think the module needs more work. I didn't want to create a release when it likely isn't fully functional.
@pgrayove This is a result of the improvement made to core in the latest release. Modules that date back before Drupal 7 may not have had any updates during the Drupal 7 life cycle and have an update hook from Drupal 6. Backdrop core now recognizes this. However, contrib modules must remove any specific lines like this. The same thing was noted here, https://github.com/backdrop-contrib/demo/issues/43
Thanks for pointing me to that specific example of the issue. Makes it really clear what the change was and why it was made.
Glad it was helpful. When you ported similarterms did you use coder_upgrade ?
I'm wondering if coder_upgrade needs a fix to spot use of pre Drupal 7 updatehooks and comment them out altogether?
Also wondering if the .DS_Store was in the Drupal 7 module or is an artifact from your dev environment and if you need to update the global .gitignore on your dev environment?
I did use coder_upgrade for porting similarterms. Yes, it looks like the .DS_Store is from my development environment. Thanks!