• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

update col plugin >> pre eval code

bea

Active Member
Hi,
I am wondering, if I can limit the update col plugin with a pre eval code.
With can edit row plugin only the last record can be edited:
Code:
switch ('{fab_tour___status_raw}') {
   case '1':
      return true;
   case '2':
      return false;
}
I would like to give the user the possibility to update only the records of the last 12 hours, but I have no idea...

Many thanks
Bianka
 
I didn't test but maybe you can modify the arrays $ids and $data.
OPTIONAL - PHP code to run before updates happen. Return false to abort updates, set $this->msg to return a response to user. Ids are in $ids, data is in $data

An other possibility:
An extra list with update col and a prefilter, showing only the "updatable" rows.
 
Hmm, looking at the code, you'd also need to update the J! input array, as well as $ids ... so after modifying $ids, do ...

Code:
$this->app->input->set('ids', $ids);

... because the method that calls the pre-eval calls other methods to do the actual updating, which also read the input array direct.

The only other option is that I add a "check can edit" option to the plugin, and run that in the main _process() method. It wouldn't be entirely trivial, but not too difficult. Maybe an hour's work.

-- hugh
 
Hi troester, hi Hugh,
many thanks for your support. It would be great to get get some extra feature for the update col plugin.
You can catch me on skype.

Cheers and happy easter!
Bianka
 
Sorry I've been hard to catch on Skype. Been catching up after my road trip out West, and working on some hard deadlines.

-- hugh
 
Hi Hugh,

please let me know, when you can work on this feature.

Cheers,
Bianka
 
I'll take a look some time today. I also need to add some tests to see if the field specified for the date is a date element, and if so, honor the 'local' setting.

-- hugh
 
The only other option is that I add a "check can edit" option to the plugin, and run that in the main _process() method. It wouldn't be entirely trivial, but not too difficult. Maybe an hour's work.
-- hugh
friendly bump
 
The only other option is that I add a "check can edit" option to the plugin, and run that in the main _process() method. It wouldn't be entirely trivial, but not too difficult. Maybe an hour's work.

-- hugh

Hi Hugh,
please let me know, if you can add "check can edit"
Cheers,
Bianka
 
We are in need of some funding.
More details.

Thank you.

Staff online

Members online

Back
Top