Skip to content

Troubleshooting

shabib edited this page Nov 7, 2026 · 1 revision

Troubleshooting

This page provides guidance for diagnosing common problems when using Backdrop Theme Setup.

Because the project is experimental, testing on a local or disposable Backdrop installation is recommended.

1. Setup Options Are Missing

Symptoms:

The theme is enabled, but its setup controls do not appear on the appearance settings page.

Check:

  • The theme machine name matches the .info filename.
  • theme-settings.php is located in the theme root.
  • The theme-specific form alter function uses the correct prefix.
  • The theme settings page belongs to the expected theme.
  • The theme files contain no PHP syntax errors.

For the example theme, the expected callback is:

function backdrop_theme_setup_form_system_theme_settings_alter(&$form, &$form_state) {
  // Theme settings form alterations.
}

2. Submit Handler Is Not Executed

Symptoms:

The settings form saves, but selected setup operations do not run.

Check:

  • The callback is registered in the form's #submit handlers.
  • The registered callback name matches the actual PHP function.
  • The library is loaded before its functions are called.
  • The selected form values are available to the handler.

Example callback:

function backdrop_theme_setup_theme_setup_submit($form, &$form_state) {
  // Process selected setup operations.
}

If this callback is used, the form registration must reference exactly the same name.

3. JSON Configuration Cannot Be Loaded

Symptoms:

An import does not start or reports invalid configuration.

Check:

  • The JSON file exists.
  • The filename and relative path are correct.
  • The file contains valid JSON.
  • Property names use double quotes.
  • There are no trailing commas.
  • The file is inside settings-content.
  • The file is readable by PHP.

Example:

$data = theme_setup_read_json(
  'backdrop_theme_setup',
  'taxonomy/terms.json'
);

Avoid absolute paths and attempts to access files outside the permitted directory.

4. Taxonomy Terms Are Missing

Symptoms:

The taxonomy import does not create the expected terms.

Check:

  • Taxonomy is enabled.
  • The target vocabulary exists.
  • The vocabulary machine name is correct.
  • The JSON contains valid term definitions.
  • Existing terms are not being mistaken for missing terms.

If a vocabulary is supplied through native configuration, confirm that it has been installed before running the term importer.

5. Content Import Fails

Symptoms:

Some or all sample nodes are not created.

Check:

  • The content type exists.
  • The configured field names exist.
  • Required fields are supplied.
  • Referenced taxonomy terms exist.
  • Referenced images and files exist.
  • The text format is valid.
  • The requested URL alias is not already in use.

Importing taxonomy terms before content often resolves missing taxonomy reference problems.

Review Backdrop's log messages for more details.

6. Images or Files Are Missing

Symptoms:

Content is created, but attached files are missing or images do not appear.

Check:

  • The original sample file exists under settings-content/files.
  • The relative filename matches the JSON configuration.
  • The target field is correctly configured.
  • The public files directory is writable.
  • The file was successfully registered as a managed file.
  • The requested image style exists.

If the original image exists but its derivative is missing, flush the relevant image style.

7. Menu Links Are Not Displayed

Symptoms:

Menu links were imported but are not visible.

Check:

  • The target menu exists.
  • Internal paths are correct.
  • Parent links are available.
  • The links are enabled.
  • The site's Layout displays the relevant menu block.
  • Access permissions allow the destination pages to be viewed.

A successfully imported menu link does not guarantee that the menu itself is displayed by the current Layout.

8. Views Filters Are Not Updated

Symptoms:

A View displays unexpected content or its taxonomy filter still uses an old term ID.

Check:

  • Views is enabled.
  • The View exists.
  • The configured display exists.
  • The filter identifier is correct.
  • The vocabulary exists.
  • The referenced term exists.
  • The JSON matches the library's expected format.

The filter updater modifies existing Views; it does not create them.

Import the taxonomy terms before updating Views filters.

9. Layout Template Does Not Change

Symptoms:

The configured Layout still uses its previous template.

Check:

  • The target Layout exists.
  • The configured template machine name is valid.
  • The template is available.
  • The JSON references the correct Layout.
  • The Layout can be saved successfully.

Be aware that changing a Layout template may affect block regions.

10. Layout Blocks Are Missing

Symptoms:

Expected blocks do not appear after configuration.

Check:

  • The target Layout exists.
  • The block plugin exists.
  • The configured region exists.
  • The block is not disabled.
  • Block visibility conditions are satisfied.
  • Required Views or other dependencies are available.

If a block depends on a View, make sure that View exists before configuring the Layout.

11. Duplicate Content or Links

Symptoms:

Repeating setup operations creates unexpected duplicates.

Check:

  • Existing content aliases.
  • Existing menu links.
  • Existing taxonomy terms.
  • Whether the original imported data was renamed or deleted.
  • Whether the JSON was modified after the first import.

The current library provides some duplicate checks, but it is not a full synchronization system.

Do not assume every operation is completely idempotent.

12. Image Style Errors

Symptoms:

Image derivatives fail to regenerate or an image style flushing operation produces an error.

Check:

  • The image style exists.
  • The style name is correct.
  • The input is a string, array, or NULL.
  • The site's image toolkit is functioning.
  • The files directory is writable.

Example:

theme_setup_flush_image_styles(array(
  'thumbnail',
  'medium',
));

Use the library helper rather than passing an image style name directly to lower-level APIs that expect a complete style definition.

13. Changes Are Not Visible Immediately

Possible causes include:

  • Cached Views results.
  • Cached Layout information.
  • Cached image derivatives.
  • Browser caching.
  • Missing dependencies.
  • Incorrect block visibility conditions.

Use the most targeted cache operation available.

Backdrop Theme Setup intentionally avoids relying on a global cache flush for every setup action.

14. Reporting a Bug

If you encounter a problem, open an issue:

https://github.com/shabib-m/backdrop_theme_setup/issues

Please include:

  • Backdrop CMS version.
  • PHP version.
  • Relevant enabled modules.
  • Theme machine name.
  • Setup operation being executed.
  • Relevant JSON configuration.
  • Expected behavior.
  • Actual behavior.
  • Relevant error messages.
  • Steps to reproduce the issue.

Remove passwords, tokens, private information, and other secrets before sharing logs or configuration files.


This page will be expanded as additional issues and solutions are identified.