? Error

User tests: Successful: Unsuccessful:

avatar Bakual
Bakual
10 Oct 2013

Trackeritem:
http://joomlacode.org/gf/project/joomla/tracker/?action=TrackerItemEdit&tracker_item_id=32314&start=0

After some discussions in #2143 about moving the advertisment message to the new postinstall message component, I wrote a small module which could do that.

It will automatically take the current option parameter and search for active messages for this component. So it will be very easy to use also in other extensions if a developer chooses to use com_postinstall.

In case of com_cpanel it uses the extension id 700 so it would show the messages for Joomla like the current popup does. So in theory we could just put that module to the cpanel position and remove the current code in cpanel layouts and it would show the message in the module position (instead of the current modal window).

I have added the code to load the module in the extension manager layout. It's basically only two lines:

$mod_postinstall = JModuleHelper::getModule('mod_postinstall');
echo JModuleHelper::renderModule($mod_postinstall, array('style' => 'well'));

I think we could even expand it so developers could add some properties or set some params to the module, like a different text or something like that.

I didn't add a message yet to the #__postinstall_messages table. I would have to try out first how that works, but looking at it, it should be possible for sure. Maybe Nicholas would be able to help here.
The notification message currently shows even when no message is available, I believe that this is a bug in com_postinstall. Looks to me like FOFModel::getTmpInstance('Messages', 'PostinstallModel', array('input' => array('eid' => 700))); doesn't take into account the passed eid parameter and always looks up the default 700 (joomla_files). But I would have to look closer into this first.

What do you think? Would that approach work?

avatar Bakual Bakual - open - 10 Oct 2013
avatar beat
beat - comment - 10 Oct 2013

That's an interesting approach for Joomla 3.x series :+1: and could be a nice contribution. :-)

Not backportable to 2.5 as it would mean to backport quite a lot of code for just a message. But we have the existing code for that eventuality.

Let's design it carefully, improve in the postinstaller what needs to be extend to at least match if not exceed in form and function of the existing implementation. E.g. that message should only be in the installer, and not in the cpanel nor in the postinstallation view imho.

We have time as we have something already working for 3.2.0, so there is no rush, and we can make it really good for a 3.2.x dot release, as it's not a new feature. :-)

avatar Bakual
Bakual - comment - 11 Oct 2013

Let's design it carefully, improve in the postinstaller what needs to be extend to at least match if not exceed in form and function of the existing implementation. E.g. that message should only be in the installer, and not in the cpanel nor in the postinstallation view imho.

Nicholas already took care of that. The messages are stored in the database with the extension id it belongs to. The cpanel only shows messages for the eid '700' (which is joomla_files). The module loaded in the extension manager would show messages for com_installer only.
The current bug in the com_postinstall messages model is that it always checks for messages with eid 700, but I think that should be easy to solve. There is code in the model which checks the input for eid, but somehow this doesn't work with the way the eid is passed.
The postinstall component view could be improved with an additional filter to show messages for the various extensions. Like by default it will show messages for eid 700 but you could switch from a dropdown to com_installer. The code for this filter is already there, and works if you use an URL parameter. We would just need to populate the select and place it in the layout. That shouldn't be too hard as well.

I will look into that :)

avatar beat
beat - comment - 11 Oct 2013

Great!

There is also a few more other items to take care of (incomplete quick list):

  • 1-click install button
  • auto-hide message when plugin installed and enabled and running
  • automatically re-show message when plugin disabled, uninstalled, or not running for whatever reason (e.g. acl)
  • setting to hide AND show again the message in Options of com_install
  • close box showing the setting (with custom tooltip to show what's going to happen when clicking) so person knows where to enable again. Alternate could be to just close the box and have another message to confirm that box got closed (yes, lol!) but that confirms it and gives instructions and link to re-enable it in "Options".
  • custom CSS styling of the message

Another thing that came to my mind is that instation is probably potientially the most memory-intensive task of Joomla's admin. Installing a 3 MB component will take at least 9 MB additional memory. If having to load FOF+component adds 2 MB, we might rapidly hit memory limits that we didn't hit before. So it would be useful to measure memory use of this compared to the simple independant message that's there and which isn't memory-intensive as it is only a few lines and doesn't load any additional library (FoF) nor component (com_postinstall).

avatar Bakual
Bakual - comment - 11 Oct 2013

Com_postinstall should be capable of doing that. You can define a condition script which will make the check if the plugin is installed and enabled and you can define an action script which will run if the button is pressed. Have a look at the current 2 factor auth message, it would be quite similar (only with added installation).

Hiding the message will be handled by com_postinstall and mod_postinstall. There is no option and no checks needed in com_postinstall anymore for this. If in future a new message is added, the notification will be automatically shown again for the new message. Nicholas did quite an awesome job there :)

avatar Bakual
Bakual - comment - 11 Oct 2013

Now to add a real message so the notice is visible again :)

avatar brianteeman
brianteeman - comment - 13 Oct 2013

Please can you can create an issue tracker for this on joomlacode and link back to it.

avatar Bakual
Bakual - comment - 13 Oct 2013

Since it's not ready to test yet I think I better close it for now and reopen it when it's ready.

Sorry for the distraction.

avatar Bakual Bakual - close - 13 Oct 2013
avatar Bakual Bakual - reopen - 15 Oct 2013
avatar Bakual
Bakual - comment - 15 Oct 2013

Added message and postinstall condition/action script.
I wasn't sure where to put the script file so I placed it at the same place where the existing eAccelerator message is.

Also removed the current message in the installer layout and related JavaScript and config option as it's no longer needed with this approach. Com_postinstall will handle this.

Should be ready for testing and feedback.
Updated with new tracker item for this.

avatar Bakual
Bakual - comment - 27 Jul 2014

Closing as tracker got closed and it isn't hardcoded anymore anyway.

avatar Bakual Bakual - close - 27 Jul 2014
avatar Bakual Bakual - head_ref_deleted - 27 Jul 2014

Add a Comment

Login with GitHub to post a comment