Problem save value in plugin

8 years 1 month 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.

8 years 1 month 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 review. Thanks!

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

Moderators: vistamediajoomlacornerggppdk
© 2018 Flexicontent. All Rights Reserved.