Problem save value in plugin

More
12 years 1 day ago #32190 by tevez15
Hi

I create a new plugin, but i cant save the values in inputs.

I have a input "title" and input "feature", but i insert "text" on input, but when i save the item and re-open, he dont have the values.

I use text field like base of the new plugin :D

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

More
12 years 1 day ago #32196 by ggppdk
Replied by ggppdk on topic Problem save value in plugin
Not saved or not load into the form when form reloads ? it could be either

Debug it like this:

In a test site:

1. edit controllers file for items manager (file: flexi_backend_dir/controllers/items.php)

2. at very end of controller function save() add:
exit;
so that execution will stop without redirection to back to item form

3. Add to you plugin to print any relevant variable,
e.g. variable $post passed to the onBeforeSaveField() function !!!
if these are good then maybe in onDisplayField() you do not load values properly, in this case you put some debugging there (remember to remove above exit; statement)

4. save item and see what is printed, change your code and click refresh , etc

-- another option would be not add exit; but instead use:
a. Use:
JFactory::getApplication()->enqueueMessage( $somedata, 'message');
b. Use a logging file !

Just the above is faster,
if $post is empty the the form field names of your plugin are wrong see how they are in other FLEXI fields

- remember in your fieldnames must be:

$fieldname = FLEXI_J16GE ? 'custom' : $field->name.'';

and for sub-properties:
e.g. for multi-property 'firstname' 'lastname'

it is

<input size="40" name="'.$fieldname.'[firstname]" value="'.$value.'" type="text" /></td>


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