Joomla 3.3.3 JFactory::getApplication()->enqueueMessage()

Did you find a bug in Joomla! 3.x but aren't sure? This forum is the place to help figure out if the problem is a bug and how to report it. If you are an experienced Joomla! user and are certain that you have found a bug please use the Bug Tracker to submit your issue.
This forum is for discussion about bugs and to get help with reporting them to the Bug Tracker: https://issues.joomla.org

Moderator: ooffick

Forum rules
Please use the official Bug Tracker to report a bug: https://issues.joomla.org
Locked
Qlimax90
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jul 28, 2014 6:58 am

Joomla 3.3.3 JFactory::getApplication()->enqueueMessage()

Post by Qlimax90 » Mon Jul 28, 2014 8:46 am

Hi everyone,

i am wondering for a long time now why the enquemessage method has no seperate title attribute..
http://docs.joomla.org/Display_error_me ... ices#Error

Code: Select all

JFactory::getApplication()->enqueueMessage('Your Message', 'type');
Actually i can use the type for setting the message title, but it is not very comfortable for multilanguage sites, because you have to create a new css class for every message title you create.

Code: Select all

JFactory::getApplication()->enqueueMessage('Your Message', 'type');
creates

Code: Select all

<div id="system-message-container">
	<div id="system-message">
		<div class="alert alert-type">
			<a class="close" data-dismiss="alert">×</a>
			<h4 class="alert-heading">type</h4>
			<div>
				<p>Your Message</p>
			</div>
		</div>
	</div>
</div>
So the css class is always a combination between alert- and the "type".

In my opinion a call like this would make much more sense, so that you can still use the bootstrap classes like success, error and so on.

Code: Select all

JFactory::getApplication()->enqueueMessage('Your Message', 'type', 'title');
In my example a

Code: Select all

JFactory::getApplication()->enqueueMessage('Your Message', 'success');
outputs the word "success" as the title, but there is no way to translate it (for example into german).

What do you think?

Kind regards,
Qlimax

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: Joomla 3.3.3 JFactory::getApplication()->enqueueMessage(

Post by H13 » Sun Aug 03, 2014 2:52 pm

Hi, the type is closed to JText method:

Code: Select all

<div class="alert alert-<?php echo $type; ?>">
					<?php // This requires JS so we should add it trough JS. Progressive enhancement and stuff. ?>
					<a class="close" data-dismiss="alert">×</a>

					<?php if (!empty($msgs)) : ?>
						<h4 class="alert-heading"><?php echo JText::_($type); ?></h4>
So in fact, if you type "success" it should be somehow translated - but of course "success" is not standard language string, so I think you right, there should be a "title" attribute, something like you have written:

JFactory::getApplication()->enqueueMessage('Your Message', 'success', 'COM_COMPONENT_SUCCESS');

because class name can be in conflict with the language string. :idea:
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

Qlimax90
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jul 28, 2014 6:58 am

Re: Joomla 3.3.3 JFactory::getApplication()->enqueueMessage(

Post by Qlimax90 » Mon Aug 04, 2014 2:51 pm

You are right, that is what i mean. Often it is really unflexible.
Should i open a bugticket for this issue?

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: Joomla 3.3.3 JFactory::getApplication()->enqueueMessage(

Post by H13 » Mon Aug 04, 2014 8:46 pm

Hi, I think, this is more a feature request than a bug but if there is some list where you can add this, please let me know then the link to this list (if bug or feature request) so I can "vote" for this as I am missing such feature a lot.
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla

Qlimax90
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Jul 28, 2014 6:58 am

Re: Joomla 3.3.3 JFactory::getApplication()->enqueueMessage(

Post by Qlimax90 » Tue Aug 12, 2014 6:21 am

Hi, i have opened a feature ticket:
http://joomlacode.org/gf/project/joomla ... 61&start=0

User avatar
H13
Joomla! Ace
Joomla! Ace
Posts: 1545
Joined: Sun Dec 10, 2006 6:39 pm
Location: Czech Republic
Contact:

Re: Joomla 3.3.3 JFactory::getApplication()->enqueueMessage(

Post by H13 » Sun Aug 17, 2014 1:52 pm

Ok
- Phoca Cart - Joomla eCommerce App - https://www.phoca.cz/phocacart
- Phoca Gallery - powerful image gallery
- Phoca Restaurant Menu - https://www.phoca.cz/phocamenu
- Phoca Download - download manager for Joomla


Locked

Return to “Joomla! 3.x Bug Reporting”