Field type 'phonenumbers' fills with zero the empty phone parts after form is saved

More
9 years 3 weeks ago - 9 years 2 weeks ago #57676 by kath
I have this small problem with my field (type international phone number):
Field has areacode and part2 and part3, but when on item-save with an empty string in part3, field fills part3 with a zero. can you or I make that effect go away? :)

and followup question: EDIT: moved this to its own question.

a usual, thanks a lot!
kath
Last edit: 9 years 2 weeks ago by kath.

Please Log in or Create an account to join the conversation.

More
9 years 3 weeks ago - 9 years 3 weeks ago #57678 by ggppdk
Hello

please test this following fix, backup and edit file
plugins/flexicontent_fields/phonenumbers/phonenumbers.php

replace:
Code:
$newpost[$new]['phone1'] = flexicontent_html::dataFilter(@$post[$n]['phone1'], $phone_maxlength, 'INT', 0); $newpost[$new]['phone2'] = flexicontent_html::dataFilter(@$post[$n]['phone2'], $phone_maxlength, 'INT', 0); $newpost[$new]['phone3'] = flexicontent_html::dataFilter(@$post[$n]['phone3'], $phone_maxlength, 'INT', 0); if (!strlen($post[$n]['phone1']) && !strlen($post[$n]['phone2']) && !strlen($post[$n]['phone3']) && !$use_ingroup ) continue; // Skip empty values if not in field group

with:
Code:
if (!strlen($post[$n]['phone1']) && !strlen($post[$n]['phone2']) && !strlen($post[$n]['phone3']) && !$use_ingroup ) continue; // Skip empty values if not in field group $newpost[$new]['phone1'] = !strlen($post[$n]['phone1']) ? '' : flexicontent_html::dataFilter(@$post[$n]['phone1'], $phone_maxlength, 'INT', 0); $newpost[$new]['phone2'] = !strlen($post[$n]['phone2']) ? '' : flexicontent_html::dataFilter(@$post[$n]['phone2'], $phone_maxlength, 'INT', 0); $newpost[$new]['phone3'] = !strlen($post[$n]['phone3']) ? '' : flexicontent_html::dataFilter(@$post[$n]['phone3'], $phone_maxlength, 'INT', 0);


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Last edit: 9 years 3 weeks ago by ggppdk.
The following user(s) said Thank You: kath

Please Log in or Create an account to join the conversation.

More
9 years 2 weeks ago #57836 by kath
about empty strings in part 3:
yes, that fixes it, thanks, ggppdk! :)

Please Log in or Create an account to join the conversation.

More
9 years 2 weeks ago #57840 by ggppdk
Hello

ok, thanks for feedback, already commited fix for upcoming v3.0.9


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.375 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline