State/Province Dropdown not working in dashboard Edit Properties when editing Multiple Users
Permalink 1 user found helpful
I've seen a few older posts about this on previous C5 versions... but none for 5.6.2.1, the current version I am running.
When you select a group of users to "mass edit", choose Edit Properties, and then edit the address... the dropdown for State/Province is there but doesn't let you select anything. If you save the edit, it completely drops the State entirely. Like all the previous posts, you can change the address fine at the individual User level. This only occurs when you are editing the address for multiple users in Edit Properties.
This is critical... we have over 900 Users and this messes with our mailing list and the user output doesn't sort properly.
When you select a group of users to "mass edit", choose Edit Properties, and then edit the address... the dropdown for State/Province is there but doesn't let you select anything. If you save the edit, it completely drops the State entirely. Like all the previous posts, you can change the address fine at the individual User level. This only occurs when you are editing the address for multiple users in Edit Properties.
This is critical... we have over 900 Users and this messes with our mailing list and the user output doesn't sort properly.
Here is a screenshot... If you try and edit the Address in the Properties popup, it appears but will not allow you to select anything. Further more, if you modify anything in the Address field by way of the Properties popup and save it, the State is dropped from the original field value.
Hello,
One thing that works to have choices in the list of states is to select another country and then re-select United States.
One thing that works to have choices in the list of states is to select another country and then re-select United States.
How odd... I assume it has something to do with the fact that the site doesn't know what to populate the State/Province field with unless you switch it from and then back to the United States?!? That definitely fixed it but it seems to be an unnecessary step and I hope there is a more permanent solution in the works from C5 that doesn't involve adding an additional step like that, especially when the fields were already set to the United States before editing.
[EDIT] Edited my first answer, now it's full proof.
You can easily fix that actually.
go to root/concrete/models/attribute/types/address and copy the file form.php
Go put that copy in root/models/attribute/types/address so as to override the original one.
Now at the bottom of the new file you have this:
You need to add a line to it like so:
And that's all.
You might have to empty your cache to see it work depending on your cache settings.
You can easily fix that actually.
go to root/concrete/models/attribute/types/address and copy the file form.php
Go put that copy in root/models/attribute/types/address so as to override the original one.
Now at the bottom of the new file you have this:
<script type="text/javascript"> //<![CDATA[ $(function() { ccm_setupAttributeTypeAddressSetupStateProvinceSelector('ccm-attribute-address-<?php echo $key->getAttributeKeyID()?>'); }); //]]> </script>
You need to add a line to it like so:
<script type="text/javascript"> //<![CDATA[ $(function() { ccm_setupAttributeTypeAddressSetupStateProvinceSelector('ccm-attribute-address-<?php echo $key->getAttributeKeyID()?>'); ccm_attributeTypeAddressSelectCountry('ccm-attribute-address-<?php echo $key->getAttributeKeyID()?>', '<?php echo $country?>'); }); //]]> </script>
And that's all.
You might have to empty your cache to see it work depending on your cache settings.
OK... I did exactly as you said, and then put the new file in the root/models folder. It works perfectly with one hitch... it says:
"Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/updates/concrete5.6.2.1_updater/concrete/core/helpers/form.php on line 404" yet it now allows me to add the State with no problem. I've included a screenshot as well. I tested it with a couple different sets of Users and it is working... just throwing that error too.
"Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/updates/concrete5.6.2.1_updater/concrete/core/helpers/form.php on line 404" yet it now allows me to add the State with no problem. I've included a screenshot as well. I tested it with a couple different sets of Users and it is working... just throwing that error too.
Here is the form file I changed as you indicated...
FYI... I just moved the latest C5 version out of the Updates folders and into the root. So the updater path is nonexistent at this point and the files are in the root.
I think the problem comes from your system as I used your file on my system and I'm not getting the error.
What version of PHP are you using?
What version of PHP are you using?
The website is hosted with Bluehost and I recently updated from PHP 5.2 to PHP 5.4 (Single php.ini)it says it is "Same as PHP 5.4, but all subdirectories will use ~/public_html/php.ini". I've attached the php.ini file. It still references 5.2 in some places... could that be it?
Just changed it to PHP 5.4, and PHP 5.4 (FastCGI)and still the same error. It doesn't mess with the functionality at all though
Frankly I have o idea. I have php 5.3 and no error message but I don't see why php 5.4 would throw this error. I looked online and basically it would happen in some specific cases that don't apply here.
Other than telling you to try 5.3 I have no idea.
You can test a few things though.
1- Delete the line I told you to add but keep the file in place.
2- bring all the other files from the original folder to the new folder so the whole attribute is overridden.
In both case see if the error still appears
Other than telling you to try 5.3 I have no idea.
You can test a few things though.
1- Delete the line I told you to add but keep the file in place.
2- bring all the other files from the original folder to the new folder so the whole attribute is overridden.
In both case see if the error still appears
Thanks for the continued help... I did both suggestions, starting with removing the line of the form.php file. The state dropdown functionality ceased, and the error went away. I added the line back and the functionality came back as did the error. I then brought the entire address directory over from the core directory and inserted it as written, without the extra line of code, and the state dropdown stopped working and the error went away. I added the line back and all is well with the exception of the error which now reads:
Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/concrete/core/helpers/form.php on line 404
I wish at times like this Concrete5 would chime in and kick it upstairs for some help.
Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/concrete/core/helpers/form.php on line 404
I wish at times like this Concrete5 would chime in and kick it upstairs for some help.
well let's try everything we can think of then.
Just keep the one file since the others didn't change anything; and add a on dom ready around the added line like so:
Just keep the one file since the others didn't change anything; and add a on dom ready around the added line like so:
<script type="text/javascript"> //<![CDATA[ $(function() { ccm_setupAttributeTypeAddressSetupStateProvinceSelector('ccm-attribute-address-<?php echo $key->getAttributeKeyID()?>'); $(document).ready(function() { ccm_attributeTypeAddressSelectCountry('ccm-attribute-address-<?php echo $key->getAttributeKeyID()?>', '<?php echo $country?>'); }); }); //]]> </script>
Swapped code and error still present with full functionality though:
Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/concrete/core/helpers/form.php on line 404
You'll have to PM me so I can send you something for your help! You are awesome!
Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/concrete/core/helpers/form.php on line 404
You'll have to PM me so I can send you something for your help! You are awesome!
Thank you for offering.
Let's try one last thing. Total shot in the dark but you never know.
Put the form.php file I have attached in root/helpers (the first file we modified should still be in place) and see if it solves the problem
Let's try one last thing. Total shot in the dark but you never know.
Put the form.php file I have attached in root/helpers (the first file we modified should still be in place) and see if it solves the problem
Functionality intact, new error now:
Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/helpers/form.php on line 34
Thanks again for taking another shot at it... I'm just happy that it doesn't affect anything. We can live with a cosmetic error in reality.
Warning: Illegal string offset 'class' in /home6/barking8/public_html/new_azsa/helpers/form.php on line 34
Thanks again for taking another shot at it... I'm just happy that it doesn't affect anything. We can live with a cosmetic error in reality.
ok.
I sent you a PM by the way in case you need some freelance done in the future.
I sent you a PM by the way in case you need some freelance done in the future.
I was having a problem with the State/Province drop list on the registration form not showing any content. Disabling CSS & JavaScript caching in the settings made the problem go away. HTH