- Issue created by @joelpittet
- ๐จ๐ฆCanada joelpittet Vancouver
I'm narrowing down on ๐ Making a theme compatible with core's theme generator is too difficult Needs work
Where this code was introduced in
GenerateTheme
:private static function namePatterns(string $machine_name, string $label): array { return [ 'machine_name' => $machine_name, 'machine_name_camel' => u($machine_name)->camel(), 'machine_name_pascal' => u($machine_name)->camel()->title(), 'machine_name_title' => u($machine_name)->title(), 'label' => $label, 'label_camel' => u($label)->camel(), 'label_pascal' => u($label)->camel()->title(), 'label_title' => u($label)->title(), ]; }
- ๐จ๐ฆCanada joelpittet Vancouver
Breaking that out with the Issue Summary example:
$patterns = [ 'old' => [ 'machine_name' => 'galactus', 'machine_name_camel' => 'galactus', 'machine_name_pascal' => 'Galactus', 'machine_name_title' => 'Galactus', 'label' => 'Galactus', 'label_camel' => 'galactus', 'label_pascal' => 'Galactus', 'label_title' => 'Galactus', ], 'new' => [ 'machine_name' => 'galactus_ta', 'machine_name_camel' => 'galactusTa', 'machine_name_pascal' => 'GalactusTa', 'machine_name_title' => 'Galactus_ta', 'label' => 'galactus_ta', 'label_camel' => 'galactusTa', 'label_pascal' => 'GalactusTa', 'label_title' => 'Galactus_ta', ], ]; $filename = str_replace($patterns['old'], $patterns['new'], $old_filename); Why does it always add TaTa_ to the new $filename in these examples $old_filename = 'galactus.settings.yml' $filename = 'galactusTaTa_ta.settings.yml' $old_filename = 'block.block.galactus_mainpagecontent.yml' $filename = 'block.block.galactusTaTa_ta_mainpagecontent.yml' $old_filename = 'block.block.galactus_pagetitle.yml' $filename = 'block.block.galactusTaTa_ta_pagetitle.yml' $old_filename = 'block.block.galactus_tabs.yml' $filename = 'block.block.galactusTaTa_ta_tabs.yml' $old_filename = 'block.block.galactus_primaryadminactions.yml' $filename = 'block.block.galactusTaTa_ta_primaryadminactions.yml' $old_filename = 'block.block.galactus_main_menu.yml' $filename = 'block.block.galactusTaTa_ta_main_menu.yml' $old_filename = 'block.block.galactus_breadcrumbs.yml' $filename = 'block.block.galactusTaTa_ta_breadcrumbs.yml' $old_filename = 'block.block.galactus_help.yml' $filename = 'block.block.galactusTaTa_ta_help.yml' $old_filename = 'block.block.galactus_drawer.yml' $filename = 'block.block.galactusTaTa_ta_drawer.yml' $old_filename = 'galactus.schema.yml' $filename = 'galactusTaTa_ta.schema.yml' $old_filename = 'galactus.theme' $filename = 'galactusTaTa_ta.theme' $old_filename = 'galactus.libraries.yml' $filename = 'galactusTaTa_ta.libraries.yml' $old_filename = 'galactus.breakpoints.yml' $filename = 'galactusTaTa_ta.breakpoints.yml' $old_filename = 'galactus.info.yml' $filename = 'galactusTaTa_ta.info.yml'
It applies to more than just files, it's only that this is easy to represent.
Still working on a solution but it would be nice to know why so many variations for the replacements were needed in the first place.
- Status changed to Needs review
3 months ago 4:32am 14 September 2024 - ๐จ๐ฆCanada joelpittet Vancouver
This affects themes like https://www.drupal.org/project/basic โ which I would like to be a starterkit theme.
- Status changed to Needs work
3 months ago 1:19pm 16 September 2024 - ๐บ๐ธUnited States smustgrave
Seems to have an error.
Could issue summary also be filled out please
Thanks.
- Status changed to Needs review
3 months ago 11:45pm 16 September 2024 - ๐จ๐ฆCanada joelpittet Vancouver
@smustgrave, I don't have a fix but the tests do demo the problem.
Updated the issue summary to help make this clearer
- Status changed to Needs work
3 months ago 3:55pm 19 September 2024 - ๐บ๐ธUnited States smustgrave
Awesome to already have test coverage. But moving to NW for the solution. Not sure it's likely to get picked up for development in review queue.