×

Notice

The forum is in read only mode.
Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC: ERROR: {"html":"saved","error":false}

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22542

  • dj
  • dj's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hi. I'm trying to implement CMC with my Joomla 3.1.5 site. I get the error:

{"html":"saved","error":false}

upon submission.

I noticed this was a recent topic on this forum, however none of the possible causes seemed to resolve the issue.

I have checked with firebug and I have no javascript errors. The following is taken from the head of my website:

<script type="text/javascript" src="/naturopa/media/system/js/mootools-core.js">
<script type="text/javascript" src="/naturopa/media/system/js/core.js">
<script type="text/javascript" src="/naturopa/media/system/js/caption.js">
<script type="text/javascript" src="/naturopa/media/system/js/mootools-more.js">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js">
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js">

I have attempted removing the jquery libraries and tested it out, however the error remains.

Do you have any idea what might be causing the issue?

Any help will be greatly appreciated.

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22548

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
well, there should be an error in the console.
Can you give me the url of the page?

Daniel

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22562

  • dj
  • dj's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hi Daniel,

I can't see any errors in the console. The url is naturopathyandnutrition.com.au

As my client has requested that the website be kept offline I have sent the login information to you in a facebook message (which will apparently appear under the 'other' section in your messages).

Thanks heaps for your help!

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22563

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
The module has the following 2 lines in it:
JHtml::script(JURI::root() . '/media/mod_cmc/js/cmc.js');
JHtml::_('stylesheet',JURI::root() .'media/mod_cmc/css/cmc.css');

the first one loads the js necessary, the second one loads the css. The module can work wihtout the css, but it can't without the js. Most probably you've removed it in your template override. Add the line that loads the js again in your template override and it should be fine.

Regards,
Daniel

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22566

  • dj
  • dj's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hi Daniel,

I added the following to my template index.php file:

$doc->addScript('/media/mod_cmc/js/cmc.js');

Firebug shows that the script is being loaded, however the error message remains upon submission. What am I doing it wrong?

Thanks again.

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22569

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
Well, because it is not only this. Why have you removed those things from your template override?
This code seems to be also missing:
$document = JFactory::getDocument();
$script = 'window.addEvent("domready", function() {
	Locale.use("'.JFactory::getLanguage()->getTag().'");
    var options = {
        language : {
            "updated" : '.json_encode(JText::_( $params->get( 'updateMsg' ))) .',
             "saved" : '.json_encode(JText::_( $params->get( 'thankyou' ) )) .'
        },
        spinner : "spinner-'.$moduleId.'"
    }
    new cmc("cmc-signup-form-' . $moduleId . '", options);
});';
 
$document->addScriptDeclaration($script);
JText::script( $params->get( 'thankyou' ) );
JText::script( $params->get( 'updateMsg' ) );

You need to rework your template override and only remove the css file if you don't need it and then do the template modifications.

Right now you are hacking into something that you don't understand and it creates exactly the problems that you have.

Cheers,
Daniel

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22574

  • dj
  • dj's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hey Daniel,

I'm not using a Template override. Rather I developed a basic one from scratch using this tutorial:

http://www.inmotionhosting.com/support/edu/joomla-3/create-template

As such the only code I have above my opening HTML tag is:

<?php

defined('_JEXEC') or die;

$doc = JFactory::getDocument();

$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap.min.css');
$doc->addStyleSheet($this->baseurl . '/media/jui/css/bootstrap-responsive.css');
$doc->addStyleSheet('templates/' . $this->template . '/css/style.css');
$doc->addScript($this->baseurl . '/media/system/js/mootools-core.js');
$doc->addScript($this->baseurl . '/media/system/js/mootools-more.js');
$doc->addScript('/media/mod_cmc/js/cmc.js');
$doc->addScript('//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js', 'text/javascript');
$doc->addScript('//ajax.googleapis.com/ajax/libs/jqueryui/1.9.2/jquery-ui.min.js', 'text/javascript');

?>

What do I need to add to this to make CMC work? Excuse my ignorance when it comes to Joomla templates. Thanks.

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22575

  • dj
  • dj's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 5
  • Thank you received: 0
Hi there Daniel,

Rather then have you field any more of my silly questions I will use mailchimps native form builder.

Thanks again for your help!

ERROR: {"html":"saved","error":false} 11 years 2 months ago #22577

  • Daniel Dimitrov
  • Daniel Dimitrov's Avatar
  • Away
  • Administrator
  • Administrator
  • Posts: 9618
  • Karma: 155
  • Thank you received: 1081
This doesn't make much sense then. If you don't use template overrides, then it should work out of the box.
You don't have a file in
your_template/html/mod_cmc/default.php ?

Aaaah, wait! wait! I know what is wrong. You most probably miss the header tag in your template.
<jdoc:include type="head" />

This needs to be placed within the <head></head> tags -> it makes sure that extensions, modules, plugins will be able to add scripts to the head.

You see if I use
$doc = JFactory::getDocument();
$doc->addScript(...);

the code won't be output if your template doesn't have <jdoc:include type="head" />
Add this to your <head> tags and the extension will most probably start to work. Without this tag other extensions won't work either...

More info here:
docs.joomla.org/Understanding_Joomla!_templates

Cheers,
Daniel
  • Page:
  • 1
Time to create page: 0.130 seconds