Couldn't get it working with pre-save but I have got this working now by using the finder to check for the record before calling the basicEntitySave - might not be the "correct" way of doing it but it works (y)
Hi,
I was just wondering if there are any guides on how to implement Alerts to add-ons correctly, I have looked around and haven't spotted anything yet
Thanks
Thanks, redirect doesn't appear to work from the _preSave, it gives and error, the same redirect code does work from the controller not with in the entity -
** Update - you have to use "return \XF::app()->router('public')->buildLink(''$url);' **
Ok I have this working now (nearly) - this->error() does kill it so that works ok, but what I would like to do is kill it without any onscreen message and then redirect to another page, is that possible? Thanks
Yes, I am using basicEntitySave in my controller, however it's highly likely I'm doing something wrong here :)
So basically I have a form in my template and the data is saved to the database once submitted, however is you click the submit quickly many times it will save the data multiple times...
Thanks, I'm getting there now kind of working, how do I stop it saving the record if duplicate exist, I get the warning but it still saves it.
So basically if duplicate error is detected I want to skip the save
Hi,
I'm trying to calculate the number of days between two dates and display the result in my template, does anyone know if the php function date_diff can be used?
Hi,
I'm using $form->basicEntitySave to save inputs from a form into my database which all works well, the only problem is that it allows duplicates which I don't want, so I'm probably missing something obvious but how do you check if the record exists before saving? Is there a build in...
Ok - I've worked out how to add the form to the template and I'm using hidden inputs to pass the variables I want to store in the database
I just need to work out the correct way to submit the form and save the data in the hidden inputs to the database, again any advice on this would be a great...
Hi,
I'm looking to add a button to a custom template of mine and then when it's clicked data is written to a table in the database, I'm not sure what the best way would be to about that, using a form, or a button? I looked around the documentation etc but still not sure, if anyone has any...
* UPDATE *
I have been working on a large update to my gamepass add-on, new features include.
1) New custom built homepage
2) New section for PC Games
3) Updated game info page
4) Gamepass history/graveyard page
5) Stats page
Plus loads of behind the scenes to keep the game list and stats up...