CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Contribute - Country & State menu goes blank
Pages: [1]

Author Topic: Contribute - Country & State menu goes blank  (Read 4573 times)

mrr2ro

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
Contribute - Country & State menu goes blank
November 02, 2009, 10:09:22 am
I see the thread about the menus on country and state behaving erratically and I have double checked the following.

I am running

PHP Built on:    Linux 2.6.18-92.1.10.el5.centos.plus #1 SMP Thu Aug 7 12:19:36 EDT 2008 i686
Database Version:    5.0.77-log
Database Collation:    utf8_general_ci
PHP Version:    5.2.10
Web Server:    Apache
Web Server to PHP interface:    apache2handler
Joomla! Version:    Joomla! 1.5.14 Stable [ Wojmamni Ama Naiki ] 30-July-2009 23:00 GMT
User Agent:    Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.29 Safari/525.13

json support   enabled
json version   1.2.1

However when selecting the donation page and selecting country US and then the state drop down menu goes blank.
If I select the state first without a country, I can select any state, but as soon as the country / state combo is used -- things freeze.

It happens in IE, Google Chrome, Mozilla FireFox, Safari, Opera.

Any Guidance will be helpful !



Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Contribute - Country & State menu goes blank
November 02, 2009, 10:18:55 am

use firebug to check the error returned on the ajax call to get the list of states.

the last person who had this error did not have the function "json_encode" in his version of PHP

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mrr2ro

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
Re: Contribute - Country & State menu goes blank
November 03, 2009, 06:29:18 am
I did see the posting about the same country/state issue and the solution about installing json.

Json is installed and php info reports it as being installed and active.

However, I did re run the json isntall pecl install json, and it reports it installed and active.

The firebug report -- Point to Line 53 on file

{
52 $(target).html("");//clear old options
53 data = eval(data);//get json array
54 if ( data != null ) {
55 for (i = 0; i < data.length; i++) {
56 $(target).get(0).add(new Option(data.name, data.value), document.all ? i : null);
57 }
« Last Edit: November 03, 2009, 06:32:06 am by mrr2ro »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Contribute - Country & State menu goes blank
November 03, 2009, 06:57:34 am

json_encode is part of php 5.2.x

i dont think u need the pecl version

http://php.net/manual/en/function.json-encode.php

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mrr2ro

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
Re: Contribute - Country & State menu goes blank
November 03, 2009, 08:14:31 am
O.K. I look at the link you  sent -- there are just long listings of sample code  to copy and paste into scripts I assume?
Are you suggesting I rewrite the whole script using those samples of code?
That goes beyond my time availability and skill set.

I am then back to the drawing board searching for an application to collect a contribution and process the payment (Something that works),
uninstal civicrm, and move on because I cannot have a form that freaks out when someone selects a country / state name -- a simple drop down menu box.

What happen to the old fashion drop down menu box with all the states listed?  Why the need to get stuck into a one particular technology and plug-ins just to display  simple drop down menu? I think it is silly to need json-encode to display a drop down menu -- a simple thing that has been part of HTML forms since the very beginning.

The whole CiviCRM process was just a learning experience without a successful outcome -- AKA (a waste of my time) - Jumping though all requirements to install and application that at the end of the day cannot display a menu listing the states of the USA.

I Do appreciate your time and I thank you  for the suggestions, but is  obvious CiviCrm is not ready yet!

I am a believer of OpenSOurce and I support it and contribute money to the projects I mange to install and use; but if CiviCrm cannot display a simple drop down menu without issues, It makes me wonder what will happen once we load data in it and we become dependent of the application.

What if when  we really need the application it fails to perform?

It will be a bigger headache, so I rather cut an run right now.

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Contribute - Country & State menu goes blank
November 03, 2009, 08:37:53 am

based on your needs and expectations and what civicrm does / does not do, there does not seem to be a nice fit

thanx for considering civicrm and your support of opensource

hopefully when you return it will be 'ready'

good luck with the search

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mrr2ro

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
Re: Contribute - Country & State menu goes blank
November 14, 2009, 08:46:23 pm
O.K. I decided not to give up and work it out --

I took some time and I made sure to follow all the requirements.

Still Even though php was recompiled with json support, and php info displays

PHP Version => 5.2.10
--enable-json=shared

additional .ini files parsed =>
/etc/php.d/json.ini,

json
json support => enabled
json version => 1.2.1

And from the shell prompt >>  php -r 'var_dump(function_exists("json_encode"));'                                                                  
And from the shell prompt >> bool(true)

The Country state combo menu still freeze ad does not display correctly --

The problem seems to be with the the SSL URL --

the menu works just fine when in test mode when everything is running as http -=- but when it switches to https --then the menu starts freaking!

However when trying to FORCE SSL in the Resource URLs -- It does not allow it - the error is
"You need to set up a secure server before you can use the Force Secure URLs option"

But the system works just fine SSL including if I submit a form selecting the states and NOT touching the country menu, the transaction works just fine, SLL is working fine.

 -- so in THEORY!!

One solution is to bypass the country field in the template, and since it is a required field -- then hand code the country field in the template so the the php code agrees with the entry.

I will post the changes next!
« Last Edit: November 14, 2009, 09:33:24 pm by mrr2ro »

kauthon

  • Guest
Re: Contribute - Country & State menu goes blank
November 17, 2009, 10:27:00 am
I have just started working on this issue as well.  For me it works on the latest versions of chrome, firefox, and IE8. but not on ie7 and macs.  If you figure anything out or just have a good lead.  Please post.  I will do the same.

mac2_

  • Guest
Re: Contribute - Country & State menu goes blank
November 26, 2009, 06:03:38 am
Hello all,

I'm a system administrator that works with MrR2ro occasionally. I've been digging on this problem a bit and have a little more information to share regarding the presentation of the issue, though I am no closer to a solution at this point and am hoping to get more guidance (this is my first exposure to CiviCRM).

The call to 'jqState' via the AJAX code in the production/published/real form is getting a full HTML page back which states "You do not have permission to execute this url." This occurs whether the jqState query URI referenced from the published form is retrieved using SSL or not (which is to say, SSL and https URIs are not the problem). MrR2ro was correct however, in saying that the form works fine when accessed through the Administration dashboard, but that's because the URI being generated to access 'jqState' is taking on a different "base" when accessed that way (this is true whether you use the 'Test-drive' link or the 'Live Contribution Page' link from the  CiviCRM  » Administer CiviCRM  » Manage Contribution Pages » Configure Contribution Page options).

Compare the following paths to help clarify the above statements...
The live page URI path:
component/option,com_civicrm/Itemid,96/view,Contributions/

The live page jqState AJAX query URI path (returning error):
index.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=billing_country_id-5&_name=billing_country_id-5&_value=1228
which results in a 301 redirect to:
component/option,com_civicrm/_id,billing_country_id-5/_name,billing_country_id-5/_value,1228/lang,en/task,civicrm/ajax/jqState/
which returns the 'You do not have permission to execute this url.' page.

The Administration dashboard 'Live Contribution Page' URI path:
administrator/index2.php?option=com_civicrm&task=civicrm/contribute/transact&reset=1&id=1

The Administration dashboard 'Live Contribution Page' jqState AJAX query URI path (working):
administrator/index2.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=billing_country_id-5&_name=billing_country_id-5&_value=1228

(I trimmed the first part of the URI in all of the above paths at the same position in the URI, in other words, all of the above paths have a common parent in the original URIs.)

After observing all of the above, I was able to get a valid data return in a browser for the live form's AJAX query URI by changing 'index.php' to 'index2.php' in that URI. (Alternately, of course, adding "&tmpl=component" to the end of the live form's AJAX query URI has the same effect.) To be crystal clear, the paths which work to return the json encoded list of states are as follows:
index2.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=billing_country_id-5&_name=billing_country_id-5&_value=1228
index.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=billing_country_id-5&_name=billing_country_id-5&_value=1228&tmpl=component


Digging through the source code which generates these URIs in the output for the contribution form, however, I see that the crmURL function call is being used which references back to the base filename of the original URI used to access the contribution form. (This explains why it works from the Administration dashboard, which uses the index2.php base.)

And that's where I get stumped as to how to go about fixing this problem. I don't know if it boils down to a problem in the way the Contribution form is being linked into the navigation of this site, or if the problem is code-side since the 'tmpl=component' isn't being forced into the URI as appears to be necessary for a working query return.

Any assistance, guidance, and/or suggestions of more things to look at are greatly appreciated.

Regards,
MAC

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Contribute - Country & State menu goes blank
November 26, 2009, 07:06:59 am

check:

http://joomla.demo.civicrm.org/index.php?option=com_civicrm&task=civicrm/ajax/jqState&&_id=billing_country_id-5&_name=billing_country_id-5&_value=1228

which should be acessible by an anonymous/auth user also. i'd try to figure out why you are getting a "no permission" error on that url

the civicrm permissioning check is done in:

components/com_civicrm/civicrm.php, function civicrm_check_permission

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

mrr2ro

  • I’m new here
  • *
  • Posts: 11
  • Karma: 0
Re: Contribute - Country & State menu goes blank
December 20, 2009, 10:44:05 am
I found the problem = and the solution!

Check plug-ins / modules / components for compatibility. I decided to disable all add-on component and trouble shoot one by one until I found the culprit.

CiviCRM without any extra components installed in works fine, I forgot the cardinal rule that there is always the possibility of components introducing compatibility issues or in my case component configuration issues.

So far what I have tested indicates that the problem is resolved, but I will keep an eye on it.

The problem has to do with the Search Engine Friendly - URL - / Human Readable URL rewriting component.
Basically it uses Apache mod_rewrite module to make cryptic urls search engine friendly and human readable.

In my case I am using sh404SEF - http://extensions.joomla.org/extensions/site-management/sef/10134
The solution was to configure the component to IGNORE SSL and force it not to SEF anything SSL.

=> There is an option under the advanced configuration menu to NOT touch or rewrite the SSL urls.
In this case I just added the address https://www.mydomain.org/components to the SSL secure URL and I checked the Force non sef if HTTPS  to YES
« Last Edit: December 20, 2009, 10:50:11 am by mrr2ro »

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Contribute - Country & State menu goes blank

This forum was archived on 2017-11-26.