FLEXIcontent Plugin Save

More
2 years 6 months ago - 2 years 6 months ago #82348 by iamrobert
We have our own custom FLEXIcontent Editor plugin - Visual Editor.

We're looking for a way to save the content of this field only rather than applying the full FLEXIcontent save as it would save the editor lots of time.

But we're stuck as we can update the plugin field in the DB, but when we hit FLEXIcontent Save and Close it wipes the data and replaces it with the old code.

We create a section: 
DATA IN FLEXIcontent is EMPTY
DATA IN DB is EMPTY

We open our editor and save content with the FLEXIcontent equivalent of APPLY
DATA IN FLEXIconteny is added
DATA IN DB is added by FLEXIcontent

The above method works.

We make changes in content with the editor & use our own save to save only the field content:
DATA In FLEXIcontent is OLD
DATA in DB is updated

Then we hit save + close in FLEXIcontent, and the old data overwrites the one saved in the DB. So - we can't figure out a way to save only the field.


See this works until we hit the save and close:


So, we can update the database field, but when we click APPLY in FLEXIcontent the old data gets submitted, and the new data goes missing.

How can we resolve this?


 
Last edit: 2 years 6 months ago by iamrobert.

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

More
2 years 6 months ago #82349 by micker
Replied by micker on topic FLEXIcontent Plugin Save
hello difficult to help you without someextra information
- flexicontent version
- joomla version
after its your dev plugin difficult debug it we didn't do it
i think the best way is to contact georgios directly

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
2 years 6 months ago #82350 by ggppdk
Replied by ggppdk on topic FLEXIcontent Plugin Save
Hello

are you using method
onBeforeSaveField to change the value to be saved ????

Inside  field method onBeforeSaveField
if you have already saved the data e.g. via AJAX, then

1. load the already saved db data
2. then set them into $post (this is the method variable that is passed by reference that contains field data to be saved)

 


-- 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
2 years 6 months ago #82351 by iamrobert
Replied by iamrobert on topic FLEXIcontent Plugin Save
Thanks for your response ggppdk.

No - we aren't using onBeforeSaveField. My developer doesn't understand the why yet.

So you are suggesting we push through our savecontent.php into the onBeforeSaveField.

gist.github.com/iamrobert/0ba321258c4cf1...file-savecontent-php

That way it'll be protected when we hit save and apply?

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

More
2 years 6 months ago #82379 by ggppdk
Replied by ggppdk on topic FLEXIcontent Plugin Save
Hello

if you want to save data in FC values table
then
of course you need to use the plugin method onBeforeSaveField
if it is a built-in field TYPE then clone the field TYPE
or
-maybe- you can use a simpler solution with less code with a plugin:
plugins/flexicontent/mycustomplg.php
and use FC event onAfterItemSave (see plugins/flexicontent/flexinotify.php plugin) to do manipulations there without cloning the field type

in any case do them in proper order and / or in proper place

Flexicontent will save its data, why it will not save its data ?
If you are not using the field data and also if you are not displaying a built-in field with a default layout (also you could get the custom DB field data inside a custom field layout and ignore given data)
but instead you are saving the data in some custom DB table then you do not need to care of what FC saves
 


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