File tree Expand file tree Collapse file tree 1 file changed +3
-14
lines changed
plugins/behaviour/versionable/src/Extension Expand file tree Collapse file tree 1 file changed +3
-14
lines changed Original file line number Diff line number Diff line change 1515use Joomla \CMS \Event \Table \BeforeDeleteEvent ;
1616use Joomla \CMS \Helper \CMSHelper ;
1717use Joomla \CMS \Plugin \CMSPlugin ;
18- use Joomla \CMS \Versioning \VersionableModelInterface ;
1918use Joomla \CMS \Versioning \VersionableTableInterface ;
2019use Joomla \CMS \Versioning \Versioning ;
2120use Joomla \Event \SubscriberInterface ;
@@ -107,24 +106,14 @@ public function onTableAfterStore(AfterStoreEvent $event)
107106
108107 $ result = $ event ['result ' ];
109108
110- $ typeAlias = $ table ->getTypeAlias ();
111- [$ component , $ modelName ] = explode ('. ' , $ typeAlias );
112-
113- $ model = $ this ->getApplication ()->bootComponent ($ component )->getMVCFactory ()->createModel ($ modelName , 'Administrator ' );
114-
115- if ($ model instanceof VersionableModelInterface) {
116- return ;
117- }
118-
119109 if (!$ result ) {
120110 return ;
121111 }
122112
123- if (!(\is_object ($ table ))) {
124- return ;
125- }
113+ $ typeAlias = $ table ->getTypeAlias ();
114+ $ component = strtok ($ typeAlias , '. ' );
126115
127- // Get the Tags helper and assign the parsed alias
116+ // Do not store version if version history is not enabled for the component
128117 if ($ component === '' || !ComponentHelper::getParams ($ component )->get ('save_history ' , 0 )) {
129118 return ;
130119 }
You can’t perform that action at this time.
0 commit comments