Invision Community 4: SEO, prepare for v5 and dormant account notifications Matt November 11, 2024Nov 11
Posted November 28, 20231 yr Clarifying what some tasks do, the desire to rename the task file / class is really needed. That said, when updating an existing installation of the application, the originally named task still exists in the applications task folder. It is also present when viewing all tasks, because it's sticking around in the core_tasks table. Running this query on upgrade appears to fail. Am I missing something? Double check the query syntax for me. \IPS\Db::i()->delete( 'core_tasks', array ('key=? AND app=?','steamCleanup','steam') ) Edited November 28, 20231 yr by Aiwa
November 28, 20231 yr Have you double-checked the old task isn't present anymore in the tasks.json file? I had the same issue once, and the problem was that the code kept re-adding it because it was still in the file.
November 28, 20231 yr Author 😞 it’s not in the tasks.json. Do I need to escape quotes so it treats the values as strings? I’ll have to try that as soon as I get back to my machine this evening.
November 28, 20231 yr Solution I believe key is a reserved keyword in MySQL. Try this. \IPS\Db::i()->delete( 'core_tasks', array ('`key`=? AND app=?','steamCleanup','steam') )
November 28, 20231 yr Ah, yes. I encountered that same issue recently on a client's site using my Moods application. Adding backticks solved it. I didn't think of that because without backticks the query threw a specific error about having a wrong LIMIT value, and you didn't mention anything like that. 😅
November 29, 20231 yr Author Thanks @Ryan Ashbrook ! That did it. I completely glossed over the fact that it was a keyword. I write enough SQL queries at work I don't know how I missed that. That said, I use a SQL syntax editor that catches that for me when I forget. 'name' is probably another one someone is likely to hit. 😄 @teraßyte, an error was being thrown, but it was the last 10ish characters of the query with a generic syntax error message.