[SOLVED] update item with custom field

More
7 years 5 months ago #64810 by ggppdk
Hello


you need to set:
new data to
$data ARRAY (see the FAQ article)

any data you do not set will maintain their existing value
only use $item to get an existing value

Code:
$item = $itemmodel->getItem($area->id); $data[...] = ...; // see FAQ article $itemmodel->store($data)


-- 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
7 years 5 months ago #64868 by fopo-web
Hi,

Now it works. Thanks for your help.


Regards,

Frank

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

More
7 years 5 months ago #64954 by fopo-web
Hi, I thing I have found a bug in the flexicontent api.

I set some custom values like this and save the item.

$item = $value;

After saving, my other custom fields (which I have not modified) will be cleared. It will not be maintain with the exisiting value.

What can I do?

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

More
7 years 5 months ago #64957 by ggppdk
Hello

yes, we need to update the FAQ article about how to load the existing values into the data array,
before calling the save operation on DB model

i ll update it today or tommorow


-- 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
7 years 5 months ago #64969 by fopo-web
Hi, do you have updated the FAQ?


regards,

Frank

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

More
7 years 5 months ago #64972 by ggppdk
Hello

try this it should work:
1. call
Code:
$data['custom'] = FlexicontentFields::_getCustomValues(array($item), 'item');

2. then change the values of $data

and post back here


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