FinalsClub / karmaworld

KarmaNotes.org v3.0
GNU Affero General Public License v3.0
7 stars 6 forks source link

note-editing branch causes typeerror in m.getComputedStyle, note does not load #402

Closed btbonval closed 9 years ago

btbonval commented 9 years ago

Visiting /note/harvard/reason-and-faith-in-the-west/resumepdf-5-27-43979, I am seeing an error on the console:

TypeError: m.getComputedStyle(...) is null wysihtml5x-toolbar.min.js:5

I think this is one of the examples @yourcelf had showed me interactively, but with the error, I don't see anything where the note should be. Unsure if that is due to the changes made with how compress works (and thus should stay in this ticket) or if it is worthy of its own ticket.

I need to double check I have run the data migration for that branch since it was changed.

btbonval commented 9 years ago

Quick confirmation that the note's HTML is properly embedded in the correct div even with the JS error, although it might be older HTML before the final data migration.

btbonval commented 9 years ago

Reverting my database before both data migrations.

# SELECT * FROM south_migrationhistory ORDER BY id DESC LIMIT 5;
 id  | app_name |                  migration                   |            applied
-----+----------+----------------------------------------------+-------------------------------
 112 | notes    | 0021_get_html_from_s3                        | 2015-02-15 04:54:34.963389+00
 106 | notes    | 0020_markdown_to_html                        | 2015-02-14 22:00:56.644405+00
...
# delete FROM south_migrationhistory WHERE id IN (106,112);
DELETE 2
# UPDATE notes_notemarkdown SET html=null;
UPDATE 956
# DELETE FROM notes_notemarkdown WHERE LENGTH(COALESCE(markdown,'')) = 0;
DELETE 57
btbonval commented 9 years ago

Interesting. I ran the 0020 data migration again and fired up the server. Looking at the same page as before, the error is now:

Use of Mutation Events is deprecated. Use MutationObserver instead. wysihtml5x-toolbar.min.js:8
btbonval commented 9 years ago

This time the note-content-wrapper div is empty. It was not last time.

btbonval commented 9 years ago

Oh, derr, this page was never a markdown page.

btbonval commented 9 years ago

Here's a test case with markdown /note/Brown/management-of-industrial-and-nonprofit-organizations/this-is-a-test-of-evernote.

I the see HTMLified note, no problem. No zoom buttons. No errors of concern on console.

So I'm going to close this ticket assuming that the typeerror problem was due to viewing a non-HTMLized note and possibly due to an incorrect older data migration.

yourcelf commented 9 years ago

Zoom controls still only show if the note was originally a PDF. This makes sense to me; I'd go further and only show them if "is_editable" is false. The only place they make sense is for viewers on the web who are viewing ugly output from pdf2htmlex.