FriendsOfFlarum / drafts

Enables creation of discussion drafts
MIT License
16 stars 7 forks source link

Opening draft outside of tag cause a few errors to pop up and some odd behavior #74

Closed nurdism closed 1 year ago

nurdism commented 2 years ago

Bug Report

Current Behavior

I made a video of my findings to better explain what is goin on: https://www.youtube.com/watch?v=vfThk2LwFqw

Create a new draft, give it a title, some content and select 2 main tags, close it and navigate to a new tag and refresh the page.

Open up the draft and a few things can happen:

if you have fof/best-answer installed. this error will pop up 3 times:

mount-redraw.jss:15 TypeError: Cannot read properties of undefined (reading 'isQnA')
    at forum.js?v=b0cfa628:594:10305
    at Array.some (<anonymous>)
    at e.<anonymous> (forum.js?v=b0cfa628:594:10278)
    at e.Mr.forEach.t.<computed> [as headerItems] (forum.js?v=b0cfa628:2:359707)
    at e.n.view (forum.js?v=b0cfa628:2:200827)
    at Function.a (forum.js?v=b0cfa628:2:140858)
    at forum.js?v=b0cfa628:2:147298
    at p (forum.js?v=b0cfa628:2:147685)
    at f (forum.js?v=b0cfa628:2:145411)
    at forum.js?v=b0cfa628:2:147195

after disabling that mod.

The other errors I encountered (see video):

index.jss:88 Uncaught TypeError: Cannot read properties of undefined (reading 'id')
    at r (index.jss:88:50)
    at Array.map (<anonymous>)
    at h (fillRelationship.jss:1:59)
    at d (index.jss:90:23)
    at t.x.initializers.add.nt.changed (index.jss:102:14)
    at t.<anonymous> (index.jss:203:14)
    at t.Rr.forEach.t.<computed> [as preventExit] (extend.tss:86:24)
    at t.e.close (ComposerState.jss:105:14)
    at L.handleEvent (render.jss:888:55)
TagDiscussionModal.jss:72 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'canStartDiscussion')
    at e.r.addTag (TagDiscussionModal.jss:72:14)
    at Array.map (<anonymous>)
    at TagDiscussionModal.jss:47:33
mount-redraw.jss:15 TypeError: Cannot read properties of null (reading 'type')
    at Draft.jss:75:125
    at Array.map (<anonymous>)
    at h (fillRelationship.jss:1:59)
    at Draft.jss:75:54
    at Array.forEach (<anonymous>)
    at e.loadRelationships (Draft.jss:70:34)
    at e.type (Draft.jss:29:32)
    at e.icon (Draft.jss:44:18)
    at e.a.view (DraftsListItem.tsxx:33:23)
    at Function.a (render.jss:30:16)

Environment

Flarum core 1.2.1
PHP version: 8.0.18
MySQL version: 10.5.15-MariaDB-1:10.5.15+maria~focal
Loaded extensions: Core, phpdbg_webhelper, date, libxml, pcre, zlib, filter, hash, json, readline, Reflection, SPL, session, ctype, curl, dom, fileinfo, gd, gmp, iconv, intl, mbstring, openssl, PDO, standard, tokenizer, xmlwriter, zip, exif, mysqlnd, Phar, pdo_mysql, apcu, Zend OPcache
+---------------------------------+---------+--------+
| Flarum Extensions               |         |        |
+---------------------------------+---------+--------+
| ID                              | Version | Commit |
+---------------------------------+---------+--------+
| flarum-flags                    | v1.2.0  |        |
| flarum-suspend                  | v1.2.0  |        |
| flarum-approval                 | v1.2.0  |        |
| fof-oauth                       | 1.2.0   |        |
| flarum-subscriptions            | v1.2.0  |        |
| flarum-tags                     | v1.2.0  |        |
| v17development-user-badges      | v1.0.0  |        |
| v17development-seo              | v1.8.0  |        |
| the-turk-diff                   | 1.1.1   |        |
| sycho-profile-cover             | v1.3.1  |        |
| michaelbelgium-discussion-views | v7.1.3  |        |
| fof-user-bio                    | 1.0.2   |        |
| fof-upload                      | 1.1.0   |        |
| fof-terms                       | 1.1.2   |        |
| fof-subscribed                  | 1.1.0   |        |
| fof-split                       | 1.0.1   |        |
| fof-sitemap                     | 1.0.3   |        |
| fof-secure-https                | 1.0.1   |        |
| fof-recaptcha                   | 1.1.0   |        |
| fof-reactions                   | 1.1.0   |        |
| fof-polls                       | 1.0.5   |        |
| fof-pages                       | 1.0.4   |        |
| fof-merge-discussions           | 1.2.2   |        |
| fof-masquerade                  | 2.1.0   |        |
| fof-links                       | 1.0.3   |        |
| fof-impersonate                 | 1.0.1   |        |
| fof-formatting                  | 1.0.2   |        |
| fof-follow-tags                 | 1.1.2   |        |
| fof-drafts                      | 1.1.1   |        |
| fof-disposable-emails           | 1.0.0   |        |
| fof-default-user-preferences    | 1.0.0   |        |
| fof-default-group               | 1.0.1   |        |
| fof-cookie-consent              | 1.1.0   |        |
| fof-ban-ips                     | 1.0.2   |        |
| fof-analytics                   | 1.0.0   |        |
| flarum-sticky                   | v1.2.0  |        |
| flarum-statistics               | v1.2.0  |        |
| flarum-mentions                 | v1.2.0  |        |
| flarum-markdown                 | v1.2.0  |        |
| flarum-lock                     | v1.2.0  |        |
| flarum-lang-english             | v1.2.0  |        |
| flarum-emoji                    | v1.2.0  |        |
| flarum-bbcode                   | v1.2.0  |        |
| clarkwinkelmann-status          | 1.0.0   |        |
| clarkwinkelmann-emojionearea    | 1.0.0   |        |
+---------------------------------+---------+--------+
Base URL: https://dicemakers.org
Queue driver: sync
Mail driver: mailgun
Debug mode: off

Additional Context I have a feeling this is just due to the 2nd tag being unloaded when I refresh the page. Just a hunch

nurdism commented 2 years ago

seems to be the same issue in #59

Eminlin commented 2 years ago

same issue on your video

image image

imorland commented 1 year ago

Should be fixed in #80