TinyMCE emoticons are not displayed in TinyMCE 4

Bug #1408542 reported by Stéphane on 2015-01-08
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mahara
High
Robert Lyon
1.10
High
Aaron Wells
15.04
High
Robert Lyon

Bug Description

Upgrading Mahara from 1.9.x to 1.10.x causes a problem with all emoticons used prior to the upgrade. No image is displayed; the link is broken.

After analyzing the situation, the folder comtaining images as been renamed. In version 1.9.x, images were in /js/tinymce/plugins/emotions/img/ ; in version 1.10 they are in /js/tinymce/plugins/emoticons/img/ folder.

To correct the problem, I copied the img folder in a new folder emotions... but it's not an elegant solution. Best solution is not to change de the name of the folder or to add a script to correct in the database the path to the emoticon images.

Changed in mahara:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → 15.04.0
summary: - tinymce emoticon problem
+ TinyMCE emoticons are not displayed in TinyMCE 4
Aaron Wells (u-aaronw) wrote :

Changing the priority from "Medium" to "High" because it can result in a bunch of broken images everywhere.

TinyMCE stores the emoticons in the text fields as hard-coded links, e.g. '<img src="http://vegas.wgtn.cat-it.co.nz/mahara/htdocs/js/tinymce/plugins/emoticons/img/smiley-cool.gif" alt="" />'. We could do some kind of database update that searches through all the user text fields and rewrites the smiley paths. Or we could patch TinyMCE so that it stores an abstract placeholder instead, and then when we display the text, run it through a filter that replaces the placeholder with the actual image URL.

It's tempting to just move the images back to their original path (which we could do by renaming the plugin from "emoticons" back to "emotions"), but the problem, is that now we've got sites out there using Mahara 1.10, with hard-coded links to the new path! So ultimately, in 15.04, we will have to do a database update to rewrite all these to the new path. :-\

Since we want to avoid database updates in minor releases, I propose the following fixes for 1.10 and 15.04:

1.10: We put a second copy of the images under the original location, htdocs/js/tinymce/plugins/emotions

15.04: We do a database script that locates instances of the old emoticon URLs and rewrites them to the new emoticon URL.

Aaron Wells (u-aaronw) wrote :

To replicate:

1. Do a clean install of Mahara 1.9 or earlier
2. Create a page
3. In the page description (or any other rich text area), put in some smileys using the TinyMCE smiley button.
4. Upgrade to Mahara 1.10
5. View the page

Expected result: You should see the smileys
Actual Result: You see broken image links, or the smiley's alt text. You do not see the smiley graphics.

For best testing results, add all 16 smiley types to the page.

Aaron Wells (u-aaronw) on 2015-01-12
tags: added: tinymce

Reviewed: https://reviews.mahara.org/4143
Committed: http://gitorious.org/mahara/mahara/commit/c132301a2347b641bb0e5da7e7b34c56e3a51f6f
Submitter: Son Nguyen (<email address hidden>)
Branch: 1.10_STABLE

commit c132301a2347b641bb0e5da7e7b34c56e3a51f6f
Author: Aaron Wells <email address hidden>
Date: Mon Jan 12 15:01:36 2015 +1300

Display pre-1.10 TinyMCE smiley images

Bug 1408542. TinyMCE 4 renamed the smiley plugin from "emotions" to "emoticons",
and consequently the smiley graphics moved from .../emotions/img
to .../emoticons/img, and all the smileys from before the Mahara 1.10 upgrade
show up as broken links.

As a workaround to make this work without a DB upgrade, we put a second copy
of the smiley images in the old location. For the next major release, we should
do a DB upgrade script that locates all references to the old location and
rewrites them to be references to the new location.

Change-Id: If5b193f526a50b5e200681cc18d4188cd55104ab

Aaron Wells (u-aaronw) wrote :

As described in my earlier comment, for 15.04 we need to write a database script that rewrites all the old smiley URLs to the new smiley URLs.

Unfortunately... this will probably be a rather intensive upgrade, because of all the places we have TinyMCE text fields! So we should make sure to test the upgrade on a large site.

If we can't make it run well on a large site... it might actually make sense to just keep two copies of the smiley icons. Even though that would be extremely hacky.

Jinelle Foley-Barnes (jinelleb) wrote :

Hi,

Thanks for testing instructions Aaron :)

Cheers,
Jinelle

Reviewed: https://reviews.mahara.org/4526
Committed: http://gitorious.org/mahara/mahara/commit/8d4b611f619513d923854cead7f69bf9fcd7c1b8
Submitter: Aaron Wells (<email address hidden>)
Branch: master

commit 8d4b611f619513d923854cead7f69bf9fcd7c1b8
Author: Robert Lyon <email address hidden>
Date: Mon Mar 30 16:51:02 2015 +1300

Updating the path to the emoticons via db (Bug #1408542)

The upgrade does a db find/replace on the fields except block_instance
configdata as that is handled special

Change-Id: Ic7add32573428b1cccbdead23dbfcd3aaba24ab0
Signed-off-by: Robert Lyon <email address hidden>

Reviewed: https://reviews.mahara.org/4568
Committed: http://gitorious.org/mahara/mahara/commit/dde6003f971cc7b693512f319146b5eb2e8e916c
Submitter: Robert Lyon (<email address hidden>)
Branch: 15.04_STABLE

commit dde6003f971cc7b693512f319146b5eb2e8e916c
Author: Robert Lyon <email address hidden>
Date: Mon Mar 30 16:51:02 2015 +1300

Updating the path to the emoticons via db (Bug #1408542)

The upgrade does a db find/replace on the fields except block_instance
configdata as that is handled special

Change-Id: Ic7add32573428b1cccbdead23dbfcd3aaba24ab0
Signed-off-by: Robert Lyon <email address hidden>

Robert Lyon (robertl-9) on 2015-04-17
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers