Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

Custom Save Messages for tables 24 Jan 2016 13:46 #13769

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
When I save a record in a certain table (i.e not ALL saves) I want a custom save message to appear. It appears the system uses the default

JLIB_APPLICATION_SAVE_SUCCESS

language string, even though it does not actually occur in the component.

How can I change this message based on the table being updated as I want to add some extra follow on instruction when a user creates a new record for a certain table

Thanks
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

Custom Save Messages for tables 26 Jan 2016 10:22 #13773

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This is in the language file.

I saw it already, but now I am working on the pure version, and the languages string are all rewrited in sligtly different way.
To fix this problem, I recommend you to add this Joomla native string. Maybe it has dissareared. Must check more.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Custom Save Messages for tables 26 Jan 2016 10:51 #13775

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
This string is written in :
en-GB.lib_joomla.ini

Two possible cases :
- Joomla lang file is not loaded at that moment.
- The string if build with an extra character or escapement that you don't see, but make the problem happening.

I have not searched more, where this message is raised, or constructed on the request. This should be Joomla native I think.
I saw some components (com_messages) wich copy thoses system strings in copy. It is an heresy, and maybe cook should do the same. But as far as I know it has always worked, so I can't see the problem.

I must dig your case.
Can you tell me wich PTL ?
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Custom Save Messages for tables 26 Jan 2016 13:42 #13780

  • MorganL
  • MorganL's Avatar Topic Author
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 438
  • Thank you received: 53
Oh I can change the default using an override no problem

What I am trying to do is a custom message tied against a table.. I.e table called RECORD the customs message would be 'Ypur record has been saved, thank you for taking the time to complete this information' but in the SAME component a table called PROFILE would out put 'Your profile record has been added'

So different message for each model save function? Make sense?
Morgan Leecy MCSE

Novell / Linux
PHP. MYSQL, Apache, node.js
Coldfusion, JQuery, HTML5
Joomla

Please Log in or Create an account to join the conversation.

Custom Save Messages for tables 26 Jan 2016 14:09 #13781

Hi,

You can fork the controller and copy the save function in it.

Then add:
$this->setMessage(JText::_('Custom save message'));
just behind
$this->_result = $result;

Probably does the trick you need.

Please Log in or Create an account to join the conversation.

Last edit: by Romkabouter.

Custom Save Messages for tables 26 Jan 2016 14:20 #13782

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
And if you build it correctly, you put this fork (or similar) in the superclass controller. So it does apply on all controllers.

The FOF way is similar to what you try to achieve.

There is two different ways :
- concat the result string AFTER 3 translations (begin, middle, end)
- concat the language key, and define every single translation. (better way, FOF way)
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

Custom Save Messages for tables 26 Jan 2016 14:21 #13783

  • admin
  • admin's Avatar
  • Offline
  • Administrator
  • Administrator
  • Chef
  • Posts: 3711
  • Thank you received: 986
The best is also to use the pluralization in some cases. (to manage the case of many items, it speaks in plural)

Maybe Joomla does it I don't remember. Confused with FOF sometimes.
Coding is now a piece of cake

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.069 seconds

Hi first of all I'd like to say that J-Cook is a great tool - the best component builder I tried so far...
Rymedia - Jonas 

Get Started