backdrop-contrib / coder_upgrade

Helps automate some/most of the work required to upgrade a module from Drupal to Backdrop 1.x
GNU General Public License v2.0
4 stars 7 forks source link

coder_upgrade_upgrade_regex_info_alter() assumes .info file belongs to module, but can also be a theme #63

Open klonos opened 2 years ago

klonos commented 2 years ago

Not sure exactly how to best do it, but at some point I think that we should implement something like this:

Change this:

function coder_upgrade_upgrade_regex_info_alter(&$file) {
...
  $to[] = "backdrop = 1.x\ntype = module";
...
}

...to something like this:

function coder_upgrade_upgrade_regex_info_alter(&$file, $type = 'module') {
...
  $to[] = "backdrop = 1.x\ntype = $type";
...
}

Then we need to figure out how to best detect whether we are converting a module of theme .info file, and where/how to pass $type accordingly.

Here's some info that might help (see: https://www.drupal.org/docs/7/theming/writing-theme-info-files#s-theme-name-requirements):

Theme .info files in Drupal 7 are required to have a name = and a core = entry (same as modules), but they may also contain entries for: