Skip to content

Refactor AjaxController to actions.#5276

Open
EreMaijala wants to merge 1 commit into
vufind-org:dev-12.0from
EreMaijala:dev-12.0-ajax-actions
Open

Refactor AjaxController to actions.#5276
EreMaijala wants to merge 1 commit into
vufind-org:dev-12.0from
EreMaijala:dev-12.0-ajax-actions

Conversation

@EreMaijala
Copy link
Copy Markdown
Contributor

@EreMaijala EreMaijala commented May 12, 2026

I tried to keep the changes to minimum while reducing dependency on Laminas MVC. The following changes were made throughout the AJAX handlers:

  • All AJAX handlers' constructors now call parent's constructor to make handling of SessionSettings more explicit and allow AbstractBase constructor to set display_errors.
  • When view helpers are used, the factories fetch them from ViewHelperManager instead of ViewRenderer.
  • TemplateRendererInterface is used instead of ViewRenderer.
  • TemplateRendererInterface has been modified for a more natural parameter order and to support one level of child templates.

@EreMaijala EreMaijala requested a review from demiankatz May 12, 2026 13:34
@demiankatz demiankatz added this to the 12.0 milestone May 12, 2026
@demiankatz demiankatz added the architecture pull requests that involve significant refactoring / architectural changes label May 12, 2026
Copy link
Copy Markdown
Member

@demiankatz demiankatz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't had time to look at all of this yet, but a couple of quick observations...

* @param ResponseInterface $response Response object
* @param ?string $template Template name, or null to use default for the action
* @param array $params Template parameters
* @param array $childTemplates Any child templates; an associative array with keys 'template' and
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more clear to say "an array of associative arrays" and to make the type array[]? If so, we'll have to change this in a few places (both methods in this interface, and also in the implementation).

*
* @return bool
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this annotation being removed? I think it's still true...

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

Labels

architecture pull requests that involve significant refactoring / architectural changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants