BCcampus / pressbooks-openstax-import

[UNMAINTAINED] Pressbooks Plugin for OpenStax Textbook Import
GNU General Public License v3.0
5 stars 0 forks source link

Dismissing the admin notice about WP QuickLaTeX doesn't stick #65

Closed greatislander closed 6 years ago

greatislander commented 6 years ago

Description

As a user, I see a notice in the admin interface stating:

Your Network Administrator has made WP QuickLaTeX available to you from your plugins menu. WP QuickLaTeX supports multiline equations, and svg image exports.

I can click the [x] to dismiss this notice, but when I navigate to a new screen it reappears.

Expected behaviour

The dismissal of the notice persists (it stays gone).

Actual behaviour

It returns.

Steps to reproduce the problem

  1. Activate Pressbooks OpenStax Importer and WP QuickLaTeX.
  2. Dismiss the notice about WP QuickLaTeX.
  3. Navigate to a new page in the admin interface.

The notice is back.

System Information

alex-418 commented 6 years ago

@greatislander Thanks for reporting, will take a look at this

alex-418 commented 6 years ago

2 issues with this. Fixed the first, trying to determine a solution to the second.

  1. JS file was not being enqueued. Fixed by adding add_action( 'admin_init', array( 'PAnD', 'init' ) ); so now vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js is showing up again.

  2. src to the JS file is wrong. Narrowed this down to Bedrock (works fine on PB sans trellis/bedrock) it's looking for the file using the magic constant __FILE__, making the src look like:https://pressbooks.test/app/plugins/srv/www/pressbooks.test/current/vendor/collizo4sky/persist-admin-notices-dismissal/dismiss-notice.js?ver=4.9.7

bdolor commented 6 years ago

@greatislander - I believe this is fixed via https://github.com/BCcampus/pressbooks-openstax-import/commit/7c76fa423f3341a92cf839be863914c98f9584db @alex-418 - I'm going to separate out the file path not working. Some other strange behaviour happening with the plugin affecting other composer dependencies. Not sure I'm a fan at this point.