?
avatar Wojton
Wojton
23 May 2017

Steps to reproduce the issue

  var messages = { "message": ["Message one", "Message two"],
                            "error": ["Error one", "Error two"]
                        };
 Joomla.renderMessages(messages);


   jQuery.ajax({
                    url: "index.php",
                    type: "POST",
                    data:
                    { 
                        option: "<?php echo $option ?>",
                        task: "messageform.sentMessage",
                        params: "<?php echo $this->params64 ?>",
                        "<?php echo JSession::getFormToken() ?>": '1',
                        msg:jQuery("#gs-message").val()
                    },
                    dataType: "JSON",
                    success: function(json){
                        var messages = { "message": ["Message one", "Message two"],
                            "error": ["Error one", "Error two"]
                        };
                        Joomla.renderMessages(messages);
                      //  Joomla.renderMessages(json.messages);

                        if(json.data == "message_send"){
                            jQuery("#ga-jq-submit-message-form").fadeOut('fast',function(){
                                jQuery(this).remove();
                            });
                        }
                    }
                });

Expected result

Correct system message

Actual result

Uncaught TypeError: Cannot read property 'joomla.jtext' of null
    at Object.e.getOptions (core.js?4d4a824…:1)
    at Object._ (core.js?4d4a824…:1)
    at Object.e.renderMessages (core.js?4d4a824…:1)
    at Object.success (messageform.html?tmpl=component&09ca28f…=1&params=YToyOntzOjM6ImFpZCI7czozO…:226)
    at i (jquery.min.js?4d4a824…:2)
    at Object.fireWith [as resolveWith] (jquery.min.js?4d4a824…:2)
    at y (jquery.min.js?4d4a824…:4)
    at XMLHttpRequest.c (jquery.min.js?4d4a824…:4)

System information (as much as possible)

Joomla >3.7 (in joomla <=3.6.5 worked)

avatar Wojton Wojton - open - 23 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2017
Labels Added: ?
avatar joomla-cms-bot joomla-cms-bot - labeled - 23 May 2017
avatar Wojton Wojton - edited - 23 May 2017
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 23 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 May 2017
Category JavaScript
avatar dgt41
dgt41 - comment - 23 May 2017

I can't replicate this!
Please make sure that core.js is loaded in your view!

screen shot 2017-05-23 at 21 22 50

code I used:

   jQuery.ajax({
                    url: "index.php",
                    type: "POST",
                    data:
                    { 
                    },
                    dataType: "JSON",
                    success: function(json){
                    }, error: function() {
var messages = { "message": ["Message one", "Message two"],
                            "error": ["Error one", "Error two"]
                        };
                        window.Joomla.renderMessages(messages);}
                });
avatar joomla-cms-bot joomla-cms-bot - change - 23 May 2017
The description was changed
avatar joomla-cms-bot joomla-cms-bot - edited - 23 May 2017
avatar franz-wohlkoenig franz-wohlkoenig - change - 23 May 2017
Status New Discussion
avatar izharaazmi
izharaazmi - comment - 28 May 2017

I can confirm this issue exists. And since I had not enough time to dive in, I am using a workaround that is making a useless JText:: script() call in my layouts.

avatar Fedik
Fedik - comment - 28 May 2017

@Wojton please enable Debug mode, and post here the javascript error again?

avatar tonypartridge
tonypartridge - comment - 2 Jun 2017

Is this not caused by not having the system-messages container rendered?

avatar andrepereiradasilva
andrepereiradasilva - comment - 3 Jun 2017

could this also be related to the progressive cache issue like #16375 (comment) ?

  1. The JHtml::_('behavior.keepalive'); inside the mod_login template file is not being processed when cache in conservative mode.
avatar Fedik
Fedik - comment - 4 Jun 2017

it should be fixed with #16488

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Jun 2017

@Wojton can you please test #16488 if it fixes this Issue & in so close this Issue – thanks.

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Jun 2017
Status Discussion Information Required
avatar joomla-cms-bot joomla-cms-bot - edited - 4 Jun 2017
avatar andrepereiradasilva
andrepereiradasilva - comment - 7 Jun 2017

#16488 should resolve the js error

But there is the issue of the joomla.jtext json could not being loaded in certains conditions and that could be the same issue as #16375 (comment)

@Wojton is this used in a module? does this happen with Progressive cache enabled?

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 19 Aug 2017

If this Issue get no Response, it will be closed at 17th September 2017.

avatar franz-wohlkoenig franz-wohlkoenig - change - 17 Sep 2017
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2017-09-17 06:13:34
Closed_By franz-wohlkoenig
avatar joomla-cms-bot joomla-cms-bot - change - 17 Sep 2017
Closed_Date 2017-09-17 06:13:34 2017-09-17 06:13:35
Closed_By franz-wohlkoenig joomla-cms-bot
avatar joomla-cms-bot joomla-cms-bot - close - 17 Sep 2017
avatar joomla-cms-bot
joomla-cms-bot - comment - 17 Sep 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 17 Sep 2017

This has been closed due to lack of response to the requests above – it can always be reopened.

Add a Comment

Login with GitHub to post a comment