I'm new here, sorry if I do anything not expected =/
I have succesfully made the scriptfile work on a module reading trough joomla docs and this group posts but I'm not able to do the same with a plugin.
The file is processed by PHP but is not copied to the install folder and the preflight function for ex is not executed. I double checked everything, the scripfile class name is the same as in the Extensions DB Element field.
I'm attaching my code example, if anybody can give me some tip :)
I believe this is already in the platform tracker as an issue but no one has done any code to solve it ... it would be most welcome I think if someone would do that.
On Friday, July 27, 2012 7:41:42 AM UTC-4, Miljan wrote:
> Hi,
> I'm new here, sorry if I do anything not expected =/
> I have succesfully made the scriptfile work on a module reading trough > joomla docs and this group posts but I'm not able to do the same with a > plugin.
> The file is processed by PHP but is not copied to the install folder and > the preflight function for ex is not executed. I double checked everything, > the scripfile class name is the same as in the Extensions DB Element field.
> I'm attaching my code example, if anybody can give me some tip :)
I didn't find that bug in the tracker but I did find another similar wich point me out to try to use this as the class name of the scripfile: "plg$group$nameInstallerScript" => plgsystemzoofilterInstallerGroup.
That did the trick :)
I'm not sure why modules are using mod_$... and plugins plg$... without the '_' but will try to figurate out and if intentional for some reason edit the docs about it.
On Fri, Jul 27, 2012 at 6:56 AM, Miljan <mil...@aleksic.es> wrote:
> Elin,
> I didn't find that bug in the tracker but I did find another similar wich
> point me out to try to use this as the class name of the scripfile:
> "plg$group$nameInstallerScript" => plgsystemzoofilterInstallerGroup.
> That did the trick :)
> I'm not sure why modules are using mod_$... and plugins plg$... without the
> '_' but will try to figurate out and if intentional for some reason edit the
> docs about it.
> To post to this group, send an email to joomla-dev-general@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-general+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.
following that logic plugins should be plg_GroupPluginname. I'm not sure if that missing underscore is on purpose because plugin usually don't user the 'plg_' structure.
BTW, I found out that the in the pre/postflight functions($type, $parent) the $type returns 'Update' in module script, but 'update' in the plugin. All this tiny details are nothing more than confusing, once aware is just about to adapt.
I'm not sure I understand your logic. "class plgGroupPluginname
extends JPlugin" is how every plugin I've seen in Joomla works, if you
name your plugin "plg_GroupPluginname" you will likely encounter
problems. The logical extension is that this is already the name
defined for plugins, it's already unique and it's in the style.
Perhaps we could have done a better job of naming things when they
were introduced but that time is a good half a decade ago. Components
are similarly named "com_componentname" and modules are named
"mod_modulename" so these are used for them as these are prefixed
names used for these extension types. So the rule is to take what it
is the existing unique name and append the value. For plugins this is
different because plugins are actually a composite of two unique
values plus "plg" as a prefix instead of "plg_". An unfortunate side
effect of being established for a while is legacy decision which with
hindsight turn out to be bad.
The installer adapter for modules should be passing lower case so
that's a bug somewhere that should be fixed.
On Fri, Jul 27, 2012 at 10:03 AM, Miljan <mil...@aleksic.es> wrote:
> Hi Sam,
> following that logic plugins should be plg_GroupPluginname. I'm not sure if
> that missing underscore is on purpose because plugin usually don't user the
> 'plg_' structure.
> BTW, I found out that the in the pre/postflight functions($type, $parent)
> the $type returns 'Update' in module script, but 'update' in the plugin. All
> this tiny details are nothing more than confusing, once aware is just about
> to adapt.
> To post to this group, send an email to joomla-dev-general@googlegroups.com.
> To unsubscribe from this group, send email to
> joomla-dev-general+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/joomla-dev-general?hl=en-GB.
OK, I now understand that the installer class name must be the same as the class of the plugin, comp, etc... thanks for pointint that out. Of course I understand that from j1.0 to 2.5 the decisions about names can't be perfect.