Code Monkey home page Code Monkey logo

Comments (6)

Oldiesmann avatar Oldiesmann commented on May 23, 2024

Started looking into this, and it's going to be a bit of a pain in my opinion.

When you go to delete bans/triggers, SMF just deletes them based on the IDs passed to the function.

To fix this, there are two options that I can think of:

  1. Find a way to pass all the info about each trigger in $_POST (hidden input fields maybe?)
  2. Run a query to get all the data.

Once we have all the data we need, we simply load it up into an array, pass it off to validateTriggers (since that will handle the log info for us), and log it like the other functions do. After that it's a simple matter of tweaking the code for the log to handle removal of bans.

from smf.

emanuele45 avatar emanuele45 commented on May 23, 2024

At the moment I don't remember what is logged adding the ban, but I suppose that if you can pass the data by POSTing then you can retrieve them after the POST...no?

from smf.

Oldiesmann avatar Oldiesmann commented on May 23, 2024

Yes, the IDs of the ban items we're deleting are passed from the form, so we'd just need to pull all the info and create a nice array akin to that returned by validateTokens(), then pass the log info off to the log function. After that it's just a few minor code tweaks to handle removal of bans.

from smf.

Oldiesmann avatar Oldiesmann commented on May 23, 2024

Before I start to work on getting this fixed, is there a way we can pass all the details via hidden input fields? It seems a bit silly to load all that info a second time just so we can log what was deleted, but I don't know enough about createList to know if there's an easy way to do the hidden fields.

from smf.

emanuele45 avatar emanuele45 commented on May 23, 2024

The problem with passing through an hidden field is that then you have to rely on the validity of the data sent by the user...
I wouldn't rely on that.

And BTW, what you have to load is just the data of the trigger...1 query, not so much I think.

from smf.

Oldiesmann avatar Oldiesmann commented on May 23, 2024

It is just one query, but it just seemed silly to reload everything. If that's the best way though, I'll go that route.

from smf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.