list_themes() and system_rebuild_theme_data() confusing in when which is used

Created on 14 October 2010, almost 14 years ago
Updated 11 May 2024, 4 months ago

Either list_themes() and system_rebuild_theme_data() shouldn't be two separate functions, or system_rebuild_theme_data() shouldn't be returning a theme list.

The data they return is quite similar (both primarily rely on _system_rebuild_theme_data), and in the same nested array, keyed by theme name, format:

  • filename, name, weight, schema_version, status, type, owner (path to engine), and the entire info array (including regions, stylesheets, scripts, settings, overlay regions...) are all identical.
  • system_rebuild_theme_data() has a template boolean, prefix (phptemplate), and a uri (which is the same as the filename).
  • list_themes() has bootstrap (always a zero, for what i've seen) and engine (phptemplate).

Flagging this developer experience issue for early fixing in Drupal 8.

#783580: what's the point of _system_theme_list()? β†’ - this issue actually fixed it by using list_themes(), but a later change put system_rebuild_theme_data() in instead.
#761608: Missing theme settings values because list_themes() has inconsistent theme object data β†’ - JohnAlbin mentions the mess of functions we have to list themes.
#925490: list_themes() should not call file_exists() on each theme's info file β†’ - a valid difference between them, but still doesn't account for two having the listing functionality in two places

When D7 is out we should mention this issue in those issues to get the right eyes on it for D8.

πŸ“Œ Task
Status

Closed: outdated

Version

11.0 πŸ”₯

Component
SystemΒ  β†’

Last updated 1 day ago

No maintainer
Created by

πŸ‡ΊπŸ‡ΈUnited States mlncn Minneapolis, MN, USA

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024