Bug: Translation / Copying loses 0 fields

More
11 years 3 weeks ago #47222 by geejay
Hello

the translation / copying function has a bug.

Checkbox fields or other fields which have field values or check box item index of false or 0 do not get copied.

This is due to the php empty check here which treats 0 / false as empty, the empty check should be removed:


foreach($fields as $field)
{
if (!empty($field->value)) {
$query = 'INSERT INTO #__flexicontent_fields_item_relations (`field_id`, `item
_id`, `valueorder`, `value`)'
.' VALUES(' . $field->field_id . ', ' . $copyid . ', ' . $field
->valueorder . ', ' . $this->_db->Quote($field->value) . ')'
;
$this->_db->setQuery($query);
$this->_db->query();
}
}

Please fix

Cheers

Geejay

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

More
11 years 3 weeks ago #47225 by micker
thanks for return

FLEXIcontent is Free but involves a very big effort on our part.
Like the our support? (for a bug-free FC, despite being huge extension) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing reviews. Thanks![/size]

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

More
11 years 3 weeks ago #47237 by ggppdk
Hello

replaced it with

if (strlen($field->value)) {...}

thanks for report

Regards


-- 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.

More
11 years 3 weeks ago #47252 by geejay
Hi,

btw, there seem to be plenty of such empty checks in the code.

Cheers

Geejay

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

More
11 years 3 weeks ago #47253 by ggppdk
Hello

yes,
there are legitimate and correct unless otherwise proven

Regards


-- 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.364 seconds
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
Save