theme_options filter isn't always triggered for exhibit themes

Open
#113 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
45/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
php
Domain
backend

Research direction

Start with Omeka_Form_ThemeConfiguration::init() and Theme::getOptions(), then trace how Exhibit Builder loads saved theme options from the exhibits table. Reproduce the configuration flow described in the issue and verify that theme_options is invoked both before and after saving configuration.

Written by the indexing model from the issue text.

Description

Once I've saved an exhibit's theme configuration, I can no longer access the values via the theme_options filter. Omeka_Form_ThemeConfiguration::init() does call this filter via Theme::getOptions() if nothing has been saved, but Exhibit Builder never calls the filter if theme options have been loaded from the exhibits table.

Steps to reproduce

  1. Implement the theme_options filter in a plugin class like so:
protected $_filters = ['theme_options'];

public function filterThemeOptions($serializedOptions, $args)
{
    echo 'asdf';
    return $serializedOptions;
}
  1. Edit an exhibit, switch to another theme, and configure it.
  2. Notice the 'asdf' at the bottom of the page.
  3. Save the theme configuration form.
  4. Press Configure again.

Expected behavior

'asdf' should still be at the bottom of the page.

Actual behavior

'asdf' is not present.

Dominant language
PHP
Stars
25
Forks
37
Avg merge
5d 19h
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from omeka/plugin-ExhibitBuilder

All issues in omeka/plugin-ExhibitBuilder

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.