Forums

Chronoforms not working after changing domain

bstrydom 02 Dec, 2015
Hello,

I originally designed my chronoform on test.mydomain.com. I recently moved the domain to www.mydomain.com and after that, it seems that SOMEWHERE the test. is still being referenced as can be seen in javascript errors.

So I opened up phpmyadmin and exported the database and searched through the database for the reference of test and could not find anything. I cleared ALL caches through Joomla because I found the test reference in the /cache directory. So i figured that it should be resolved as it was probably a cache but it is STILL doing it and if I check the cache it is there again.

any ideas?

Thanks
Brett
GreyHead 02 Dec, 2015
Hi Brett,

No obvious suggestions - I think that the core code is quite good at using the constants and code that makes it domain independent. Do you have any custom code in the form - Load JavaScript File for example where the domain might be hard-coded?

Which files are showing the errors - that might give a clue?

Bob
bstrydom 02 Dec, 2015
Hi Bob,

Thanks for replying I grepped the entire directory for the words test.mydomain and the only place it found something was in the cache folder so I know it's not a parameter setting in any config files. As mentioned before I also exported the database and checked that too. So I'm totally confused.
GreyHead 02 Dec, 2015
Hi Brett,

It could still be Custom code in a form - the form data is saved in the database in a base64 encoded string so a search wouldn't show it up.

Bob
bstrydom 02 Dec, 2015
I found the URL. Thanks Bob. It was in the load javascript event.

That is fixed now but the form is still not sending out the actual mail and saying it is successful.
If I run the test form to check if the form is working, it doesn't load all the fancy shmancy mouseovers and things but the form works and send the mail.

If I load it from the website itself, the form doesn't send the mail and say successful. So I'm again at a loss here.

I hope you don't mind but I have PM'd you the link to the site.
GreyHead 02 Dec, 2015
Hi Brett,

That's fine, I'll take a look, probably in the morning as it's late now over here.

Bob
bstrydom 02 Dec, 2015
That's perfectly fine. Thanks Bob.
GreyHead 03 Dec, 2015
Hi Brett,

I suspect that there is some more updating to be done - the site is still loading MooTools and a bunch of other files that probably aren't needed in Joomla 3.4

When you click the Test form icon there are a couple of JavaScript errors, both related the Max Length jQuery plug-in. That is happening because jQuery isn't being loaded before that script snippet in the form is run. I added this in with the PHP in that action to force the load
JHtml::_('jquery.framework');


The submission problem is the perennial one of Joomla! SEF URLs, (see this FAQ) I have set Relative URL to No and I now get redirected to the FBI so I assume that's worked OK.

Bob
bstrydom 03 Dec, 2015
H Bob,

It is working now. πŸ™‚ Thank you. However, there seems to be a problem with the menu at the top. For some reason it is not loading the templates menu. It is loading the wrong menu. See snapshot in this private section:

This is private content



Also, I'm not sure what you mean by this. What updating are you referring to?


I suspect that there is some more updating to be done - the site is still loading MooTools and a bunch of other files that probably aren't needed in Joomla 3.4



Let me know soonest.πŸ™‚

Thanks for your help as always.

Brett
GreyHead 03 Dec, 2015
Hi Brett,

I guess that's because the menu isn’t assigned by default. A couple of choices there you can either redirect to a 'Thank you' article; or you can set a Hidden Menu for the On Submit page as described in the FAQ I linked to (I'd probably do that).

The 'more updating' comment was because you rarely see MooTools on a Joomla! 3 site unless it's a hangover from some earlier version of a template or component. I didn't dig any deeper than a quick glance at the files that are being loaded but I wondered if the template had been upgraded to a j3 version.

Bob
bstrydom 04 Dec, 2015
Really appreciate everything but if I want to redirect to a Thank you article, can I have two articles? one for each language? and how do I set that up exactly? Is there a tutorial on how to do this?
GreyHead 04 Dec, 2015
Hi bstrydom,

The simplest way is to use a Custom Code action instead of the ReDirect action something like this:
<?php
$lang = \JFactory::getLanguage();
switch ( $lang->getTag() ) {
  case 'de-DE':
  default:
    $lang_string = 'de';
    break;
  case 'en-GB':
    $lang_string = 'en';
    break;
  case 'fr-FR':  default:
    $lang_string = 'fr';
    break;
  case 'ay-AY':
  default:
    $lang_string = 'ay';
    break;
}
$url = '. . ./'.$lang_string.'/. . . '; // add the other parts of the thank you page url here 
$app = \JFactory::getApplication();
$app->redirect($url);
?>
!!! I've added the language tags from memory, check to make sure that they are correct !!!

Bob
bstrydom 04 Dec, 2015
and where exactly would i put that custom code?
GreyHead 04 Dec, 2015
Hi bstrydom,

". . . a Custom Code action instead of the ReDirect action . . ." Drag one over to the same location in the On Submit event, drag it up before the ReDirect action and add the code to it. Once it works you can delete the ReDirect action.

Bob
bstrydom 05 Dec, 2015
Ok, I changed your code slightly to look like this:

This is private content



The reason is because your code did not take in to account the fact that I have to have two articles. One for each language. I have managed to get it working exactly how I need.

The WEIRD thing though is each article STILL shows the MAIN Menu and not it's respective language menus. The menu items are Single Article Layout and I have set the associations in Joomla to the respective language items but it still shows the Main Menu. Have you got any ideas how to fix that?
bstrydom 05 Dec, 2015
Whats also interesting is that I have another article that I display in the EXACT same way with the exact same menu layout option and that article shows the correct menu.

I have compared the two menu items and two articles and every option is identical except for the category assignment which differs. This is baffling me
GreyHead 05 Dec, 2015
Hi bstrydom,

Sorry I don't have any suggestions about the menu settings :-(

Bob
bstrydom 06 Dec, 2015
I figured I would provide the fix in case someone else needs it in future.

I use a rockettheme template.
The problem was due to an assignment checkbox of that menu item in the template settings itself.

So I went to Extensions -> templates

select the relavant language template and proceed to the Assignments section. then enable that menu item on that page.
This topic is locked and no more replies can be posted.