Jump to content

Featured Replies

Posted

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 by Aiwa

Solved by Ryan Ashbrook

Go to solution

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.

  • 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. 

  • Solution

I believe key is a reserved keyword in MySQL. Try this.

\IPS\Db::i()->delete( 'core_tasks', array ('`key`=? AND app=?','steamCleanup','steam') )

 

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. 😅

  • 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.

Recently Browsing 0

  • No registered users viewing this page.