Skip to content

Remove the legacy FacetedBrowse show-all path #63

Description

@jimsafley

The seven faceted browse facet types now implement FacetedBrowse's getShowAllValues() contract, added in omeka-s-modules/FacetedBrowse#59. The older path is kept alongside it so that installs running a FacetedBrowse from before that change keep working: their data forms pass a url, and the table is fetched from this module's own controller instead of FacetedBrowse's endpoint. On a current FacetedBrowse none of it runs.

That path is 205 lines, 156 of them code, in eight places:

  • src/Controller/SiteAdmin/FacetedBrowse/IndexController.php
  • src/Service/Controller/SiteAdmin/FacetedBrowse/IndexControllerFactory.php
  • the router block in config/module.config.php
  • the controllers entry in config/module.config.php
  • the two Cannot add all strings in js_translate_strings, which only this path can reach
  • url in the seven facet data forms
  • the flat property_id query parameter beside it in those forms, which only this controller reads. The nested facet_data[property_id] serves the new endpoint and stays.
  • numericAddAll() and the #add-all switch in asset/js/faceted-browse/category-form.js

These have to come out together. Removing url on its own is the dangerous one: the released show-all.phtml renders data-url unguarded, so an absent url produces data-url="" and the resulting $.get('') injects the whole admin page into the sidebar.

There is no declarative way to require a FacetedBrowse version, since module.ini constrains only the Omeka version and Omeka has no inter-module dependency mechanism. So this is a judgement about how widespread the newer FacetedBrowse has become, stated in the release notes, or a runtime check through Omeka\Module\Manager if a hard gate is wanted.

Implemented in feature/show-all-contract.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions