mantisbt-plugins / Announce

Announcements plugin for MantisBT, lets privileged accounts create and post announcements that can be shown to users on a global or per-project basis, and allow users to dismiss individual messages.
MIT License
20 stars 14 forks source link

DB error 401 when installing on PostgreSQL #40

Closed gamerboy11 closed 5 years ago

gamerboy11 commented 6 years ago

HI there I have mantis bt running just fine on a Windows server. Using postgresql as the db Now I am trying to load up some plugins like your announce, and I am getting this error APPLICATION ERROR #401 Database query failed. Error received from database was #-2: ERROR: syntax error at or near "d" LINE 1: DELETE d. ^ for the query: DELETE d. FROM BT_plugin_Announce_dismissed_table d LEFT JOIN BT_plugin_Announce_context_table c on c.id = d.context_id WHERE c.id IS NULL. Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

Do you know how I can fix this and get your plugin to work for me?

gamerboy11 commented 6 years ago

Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://192.168.1.111/bt/plugin_file.php?file=Announce/announce.css". plugin_file.php?file=Announce/announce.js:1

Also when I looked in the browser F12 tools, I saw this error.

ALso when I tried to get a different plugin working Taskodrome, I think it gave me similar errors like this in the F12 tools

I am using version 2.15.0 of the mantis bt software, and I am trying to use your older version 2.11. It installed this time, but now is giving these other others.

So after using the older version of your software, I was able to create an announcement, but up at the top of the page where it should be at, there is just like some whitespace all the way across the top of the page. And I believe that is where the message/announcement is supposed to be at. I suppose if its not loading the announce.css file correctly (due to the error message above), then of course the announcements will not look right. I would really like to use this plugin !! ;-)

dregad commented 5 years ago

I created #42 to track your second issue, which is not related to the original post.

dregad commented 5 years ago

@gamerboy11 I could reproduce the SQL error in a fresh install of Mantis 2.17.1 and Announce plugin 2.3.0. Will look into it.

dregad commented 5 years ago

@gamerboy11 I have a fix nearly ready for this, just pending some tests. I should be able to push it later today if all goes well.

Until then, since this is a new install, you should be able to workaround the problem by

  1. installing version 2.1.1, then
  2. run
    update mantis_config_table set value=5 where config_id = 'plugin_Announce_schema';

    This will bypass the upgrade step which contains the offending SQL.

  3. you can then upgrade the plugin to the latest version.

Of course you might still get errors if you delete an announcement or perform some other operation that triggers a deletion from the dismissals table (there is a similar SQL statement in dismiss.php).