Jump to content

saving inputfield config values via api fails


jploch
 Share

Recommended Posts

Hey!
Today I discovered a strange behaviour with a fieldtype module Iam currently developing.
I have a function that updates the config of the corresponding inputfield module, this functon is called via ajax to update one of the config options (a textarea) with some data. The strange thing is that sometimes it works and then sometimes it saves the new value but deletes all the other config options. Any Ideas why this could be happening? Here is the code that saves the inputfield config, this code is inside a process module and gets called via ajax: 


$settingsName = $this->sanitizer->text( $_POST['settingsName'] );
$settingsValue = $_POST['settingsValue'];

        if ( !empty( $settingsName ) && !empty( $settingsValue ) ) {

            $f = $this->fields->get( "pgrid" );
            $f->set( $settingsName, $settingsValue );
            $f->save();
            return;
        }

(testet on lates PW master Version 3.0.184)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...