No Code Attached Yet
avatar Ruud68
Ruud68
26 Apr 2026

FormView adds the versions button to form views with the following code:

            if (ComponentHelper::isEnabled('com_contenthistory') && $this->state->get('params')->get('save_history', 0) && $itemEditable) {
                $toolbar->versions(
                    $this->option . '.' . $viewName,
                    $this->item->{$this->keyName}
                );
            }

The issue that we have is that it assumes that when there is a component parameter 'save_history' and that is set to yes, that all views of that component have version history implemented.

This is not correct as it will display the Versions button on views for which there is no and there should not be version history.

The workaround here is to before calling parent::addToolbar, first do a $this->state->get('params')->set('save_history', 0);

The fix should however be in the FormView where e.g. is also checked if the model is implementing VersionableModelInterface

avatar Ruud68 Ruud68 - open - 26 Apr 2026
avatar Ruud68 Ruud68 - change - 26 Apr 2026
Labels Removed: ?
avatar joomla-cms-bot joomla-cms-bot - change - 26 Apr 2026
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 26 Apr 2026
avatar chmst
chmst - comment - 26 Apr 2026

Should be fixed with this PR: #47659

avatar Ruud68
Ruud68 - comment - 26 Apr 2026

@chmst , don't think so.
For extension save_history = 1
This will not fix it as it still applies to all views even the views that do not have version history

avatar joomdonation
joomdonation - comment - 26 Apr 2026

The fix should however be in the FormView where e.g. is also checked if the model is implementing VersionableModelInterface

Check model implements VersionableModelInterface is not enough. We still support legacy version history, mean need to also fallback to check if table implements VersionableTableInterface. Would be great if you can make a PR to fix this :)

avatar Ruud68
Ruud68 - comment - 26 Apr 2026

Hi @joomdonation , good point!
Btw. I can't :)

avatar joomdonation
joomdonation - comment - 26 Apr 2026

Btw. I can't :)

@Ruud68 Hope you can test the PR #47694 :)

Add a Comment

Login with GitHub to post a comment