?
avatar Devportobello
Devportobello
18 Jun 2015

Context

When using Joomla! versioning feature, we are able to fix a number of history limit in configuration.

Actual limitation

This history limit is only applied of the component context eg: com_banners.
If you want to got (wanna keep using banners component for exemple) only 10 history limit for banner and 5 for client (dunno if this could be real) this is not possible.

And now?

Adding another context, eg:

<field
    name="history_limit.banner"
    type="text"
    filter="integer"
    label="JGLOBAL_HISTORY_LIMIT_OPTIONS_LABEL"
    description="JGLOBAL_HISTORY_LIMIT_OPTIONS_DESC"
    default="5"
/>

This possibility could help in third application (got some component who need this new feature), also maybe in actual joomla component; just want to know (got some feedback) if people agree with that.
Or maybe im wrong and there is another way.

Code

Contenthistory Helper
To

// Load history_limit config from extension.
$aliasParts = explode('.', $this->typeAlias);
$context = (isset($aliasParts[1]))?'.'.$aliasParts[1]:'';
if ($maxVersions = JComponentHelper::getParams($aliasParts[0])->get('history_limit'.$context, 0))
{
    $historyTable->deleteOldVersions($maxVersions);
}

PLUS checking if only get('history_limit', 0)) for B/C

avatar Devportobello Devportobello - open - 18 Jun 2015
avatar Bakual
Bakual - comment - 18 Jun 2015

I don't think we need that anywhere in core. But if it's

  • simple code
  • helps some 3rd party extensions
  • is backward compatible

then I don't see why we can't add it.

avatar zero-24 zero-24 - change - 18 Jun 2015
Category Feature Request
avatar zero-24 zero-24 - change - 19 Jun 2015
The description was changed
Labels Added: ?
avatar brianteeman
brianteeman - comment - 19 Jun 2015

As you have code to fix the problem. Can you send your changes as Pull Request? If you need help try this doc: https://docs.joomla.org/Using_the_Github_UI_to_Make_Pull_Requests else let us know what you need :smile:


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/7191.

avatar Devportobello Devportobello - close - 19 Jun 2015
avatar Devportobello
Devportobello - comment - 19 Jun 2015

Closing for #7206

avatar Devportobello Devportobello - change - 19 Jun 2015
Status New Closed
Closed_Date 0000-00-00 00:00:00 2015-06-19 15:04:12
Closed_By Devportobello
avatar Devportobello Devportobello - close - 19 Jun 2015

Add a Comment

Login with GitHub to post a comment