VirtueMart Forum

VirtueMart 2 + 3 + 4 => Virtuemart Development and bug reports => Topic started by: SteP[IT] on December 18, 2016, 13:39:51 PM

Title: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: SteP[IT] on December 18, 2016, 13:39:51 PM
Hi All
In the past I made a simple javascript (using jQuery functions) to hide/show some fields in user registration/edit from: this script hides some fields based on the first user form radio button value.
It hides/shows tables and fields based on their id (I customized the VM edit_address_userfields.php template to add id to tables).
After upgrading from 3.0.16 to 3.0.18.6 I have a problem in displaying Country and City dropdowns: the VM script is no more able to assign them their dynamic width.
Is there a way to understand which VM recent change is causing this??? I can't locate the script currently assigning the dynamic width to the dropdowns.
You can see the 3.0.16 version working at http://toolware.it/it/registrazione-clienti-rivenditori.html : clicking on one of the radiobutton values 'Mi iscrivo come CLIENTE PRIVATO (NON HO una PARTITA IVA)' or 'Mi iscrivo come SOCIETÀ/Libero Professionista (HO una PARTITA IVA)' or 'Mi iscrivo come RIVENDITORE' the script toggles some fields as desired. The same script dosn't work anymore in VM 3.0.18.6, so I presume something changed somewhere...
It seems the actual VM version can't assign dinamyc width to elements having an id and/or being hidden, but the previous was working.
Thank you in advance for any hint.
Regards
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: GJC Web Design on December 18, 2016, 17:06:12 PM
are u now "Using Chosen" in the frontend and before u weren't?
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: SteP[IT] on December 18, 2016, 17:20:24 PM
I have simply upgraded to VM 3.0.18, no other changes: the table containing Country and City dropdowns are set to hidden when loading the page, and then set to show when checking the radiobutton, as before.
But before the dropdowns width were correctly assigned (calculated on the dropdown field content), and now are  set to 0

After upgrading I get for example this:
<div id="virtuemart_country_id_field_chzn" class="chzn-container chzn-container-single" style="width: 0px;">

before uprading I was getting this:
<div id="virtuemart_country_id_field_chzn" class="chzn-container chzn-container-single" style="width: 351px;">

As you can see, before upgrading the width was correctly assigned to the <div>. And it was also correctly changing when choosing another dropdown value, according with the choosen dropdown value string lenght
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: GJC Web Design on December 18, 2016, 17:39:19 PM
maybe the chosen version has changed  .. or chosen can't detect the width if initially set to display none?
test by displaying initially
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: SteP[IT] on December 18, 2016, 17:43:31 PM
Already tested when the table is initially set to display, and it works. It doesn't work anymore when the table start as hidden. Any hint on where to look to find what has changed?
Previuos VM version was working also when table was hidden
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: GJC Web Design on December 18, 2016, 23:28:45 PM
http://dev.virtuemart.net/projects/virtuemart/repository

but with a quick look I don't see anything that would affect what you mention
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: SteP[IT] on December 19, 2016, 07:53:19 AM
Yes, I made the same look for: this is why I'm asking for any hint... maybe Milbo could please help me, when having spare time? Thanks in advance. Regards
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: GJC Web Design on December 19, 2016, 11:18:28 AM
In the meantime can u not just target the width with a css !important if the width is the only problem?
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: SteP[IT] on December 19, 2016, 11:26:24 AM
I would, but the width it embedded and set dynamically: it's not assigned to the intial dropdown (that is actually hidden by VM default mode) created by php template, but to an overlapped dropdown element probably inserted by a script, so it's impossible for me to set it in any manner without locating the script originating it (due to my limited specific knowledge)
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: SteP[IT] on December 19, 2016, 16:06:35 PM
To get the same results I have sorrounded each table with a div, zeroing its height. It seems to have solved the issue.
Thank you anyway for helping
Title: Re: Problem in custom function in user edit address after upgrade 3.0.16 -> 3.0.18.6
Post by: Milbo on December 19, 2016, 23:00:01 PM
Strange thing. Step. I have no clue, why it changed.