Discourse calendar plugin


(Angus McLeod) #9

Nice work! This plugin is intense…

One change you might want to make is to use the PluginStore or PostCustomField rather than create a new table in the db for storing schedules for posts, and migrating the db when the plugin is installed.

The problem with creating a new table and then migrating the user’s db is that you can’t easily undo it if the plugin is uninstalled. See further:


(Angus McLeod) #10

I’ve just submitted a PR which fixes the bug preventing the calendar modal from appearing when composing a new post. With this minor fix, the plugin works as described by @koreamic.


(lxk ) #11

Top notch! It’s now working beautifully


(Andrew Waugh) #12

This plugin seems to break with 1.8.0.beta10. I tried installing it for the first time this morning.

There were no errors during the rebuild. The site came up but the rendering was all messed up - it looked like everything was at 300% zoom and /logs showed:

ActionView::Template::Error (undefined method `discourse_stylesheet_link_tag' for #<#<Class:0x007fe78d65bce8>:0x007fe7871de4c8> Did you mean? discourse_staff_notes_path) /var/www/discourse/app/views/
Failed to compile desktop stylesheet: Error: File to import not found or unreadable: vendor/fullcalendar/fullcalendar.scss. Parent style sheet: /var/www/discourse/plugins/discourse-calendar/ass
Failed to compile mobile stylesheet: Error: File to import not found or unreadable: vendor/fullcalendar/fullcalendar.scss. Parent style sheet: /var/www/discourse/plugins/discourse-calendar/asse
Failed to compile desktop_rtl stylesheet: Error: File to import not found or unreadable: vendor/fullcalendar/fullcalendar.scss. Parent style sheet: /var/www/discourse/plugins/discourse-calendar
Failed to compile mobile_rtl stylesheet: Error: File to import not found or unreadable: vendor/fullcalendar/fullcalendar.scss. Parent style sheet: /var/www/discourse/plugins/discourse-calendar/
Failed to compile desktop stylesheet: Error: File to import not found or unreadable: vendor/fullcalendar/fullcalendar.scss. Parent style sheet: /var/www/discourse/plugins/discourse-calendar/ass

#13

I upgraded a few days ago to v1.8.0.beta10 +3

The calendar plugin was installed before, and it still works after the upgrade.


(Andrew Waugh) #14

Interesting.

I just tried adding the calendar plugin to app.yml again and did a rebuild.

Here is what the page looks like after the rebuild:

and /logs shows the same “failed to compile” error.

Either there is a problem with the plugin not having been installed before the current beta release, or it is some kind of conflict between the calendar and my other plugins. Here are the plugins I have at the moment:

  - git clone https://github.com/discourse/docker_manager.git
  - git clone https://github.com/discourse/discourse-data-explorer.git
  - git clone https://github.com/leodavidson/discourse-reset-bump.git
  - git clone https://github.com/Ebsy/discourse-nationalflags.git
  - git clone https://github.com/discourse/discourse-staff-notes.git
  - git clone https://github.com/davidtaylorhq/discourse-whos-online.git
  - git clone https://github.com/discourse/discourse-narrative-bot.git
  - git clone https://github.com/koreamic/discourse-calendar.git

My bet is that the recent changes to styles have something to do with this.


Blank page / http error 500 after upgrading
(lxk ) #15

I got the same behavior, no styles. Mine was working previously

I also have the who’s online plugin. Rebuilding minus the calendar worked


#16

Anything new on this issue? I just upgraded my app to discourse 1.8.0.beta11 and now I got the same behavior. Solawi Dortmund No styles and this message:

Error: File to import not found or unreadable: vendor/fullcalendar/fullcalendar.scss. Parent style sheet: /var/www/discourse/plugins/discourse-calendar/assets/stylesheets/discourse-calendar.scss on line 1 of plugins/discourse-calendar/assets/stylesheets/discourse-calendar.scss @import "vendor/fullcalendar/fullcalendar"; ^ ';

./launcher rebuild app did not work for me.

What do you mean by gallery? Is there a gallery plugin?

Is there a way to get to the point before the upgrade? I’m using the backup service in discourse on a daily basis, but there are no stylesheets saved in this backup, right?

docker images -a gives me:

REPOSITORY TAG IMAGE ID CREATED SIZE local_discourse/app latest c1da1a574d92 19 minutes ago 2.58 GB <none> <none> ab678b5e6ac2 3 weeks ago 2.5 GB discourse/discourse 1.3.10 1881a9bd3afd 4 months ago 1.54 GB samsaffron/docker-gc latest 54ca424ca8d6 18 months ago 57.7 MB

Is it possible to use an older image? The one 3 weeks ago + my backups? How could I do this?


#17

I removed the calendar plugin from app.yml-file and rebuilt the app. Styles are back without the calendar.
But since the calendar feature is quite key to my community, I’m more than happy for any help for this issue.


(lxk ) #18

sorry typo, I meant calendar. There was also a broken image gallery plugin that was also in the mix at the time.

there might be a way to work around it if you don’t use launcher and build using an older image


(Sam Saffron) #19

Keep in mind, this topic is in the #plugin:broken-plugin category for a reason :persevere:


#20

Renaming the vendor .css files to .scss files fixes it for me


(DiscourseMetrics.com) #21

The latest version now works. However, the requests to the backend to get the schedules for a given month take up to 20-30 seconds, which means nothing is initially shown in the calendar when opening it. The requests only take this long when there are actual events in that month. If there are no events, the request returns in <180ms.

Do you have similar issues @craisp @lxk @koreamic? :slight_smile:


(lxk ) #22

An existing schedule (for yesterday’s date) appeared instantly after re-enabling the calendar. I’ll have to test and see if I get the same delay behavior for newer instances

edit: further testing reveals no delays - though my calendar isn’t exactly flush with schedules


(DiscourseMetrics.com) #23

I only have a few events in the calendar, so I don’t think that’s why it is so slow. Perhaps there are some slow database queries somewhere, I do have around 100k posts in my forum - maybe it is related to that. Will do some more digging. Thanks @lxk :slight_smile:


(DiscourseMetrics.com) #24

There appears to be way too many SQL calls going on when fetching data for the calendar, over 6500 taking 27 seconds…

These appear to be the 6500…

It’s looking up tons of single rows in post_schedules… not sure why.

I’m using the Babble plugin as well - are you guys? :slight_smile:

Any ideas for how to fix this are welcome :slight_smile:


(DiscourseMetrics.com) #25

I think I figured it out. For some reason the plugin checks every post in a topic that has a schedule added to it. So, if like i did, you add a schedule in a post in a topic with thousands of replies, it scans each one resulting in a huge number of SQL queries. I guess the solution is to only add schedules in separate schedule-topics and discourage replies in those topics.


#26

Is this still being maintained? Just wondering, because it’s in the #plugin:broken-plugin category…


#27

I’ve just submitted a PR fixing the modal show up to compose a new schedule. With this, the plugin works for now.


#28

Thanks. I tried the updated version but having it installed prevents the launcher from rebuilding the app. Updates to newer Discouse versions also no longer work while the plugin is listed in the app.yml.