Forums | Mahara Community

Support /
skins broken on upgrade from 19-04 to 19-10


henrythemouse's profile picture
Posts: 17

12 December 2019, 14:11

I just finished upgrading to 19-10 and immediately noticed that my pages didn't display the skin I had assigned to them in 19-04. So, I tried to re-assign the skins but mahara wouldn't do it. I got a "loading ..." notification in the header area that never went away. I tried to create a new skin and got the same thing. All my skins show in the skin overview, but none of them are applied. The apache log:

 

<<<

referer: https://domain.tld/view/view.php?id=69
[WAR] e3 (lib/errors.php:536) [Error]: Call to a member function get() on null, referer: https://domain.tld/skin/design.php?id=9
Call stack (most recent first):, referer: https://domain.tld/skin/design.php?id=9
* exception(object(Error)) at Unknown:0, referer: https://domain.tld/skin/design.php?id=9
[php7:notice] , referer: https://domain.tld/skin/design.php?id=9
 [php7:notice] [WAR] d2 (lib/errors.php:536) [Error]: Call to a member function get() on null, referer: https://domain.tld/skin/design.php
[php7:notice] Call stack (most recent first):, referer: https://domain.tld/skin/design.php
[php7:notice] * exception(object(Error)) at Unknown:0, referer: https://domain.tld/skin/design.php
[php7:notice] referer: https://domain.tld/skin/design.php

>>>

 

Can you help me solve this?

TIA

 

 

Robert Lyon's profile picture
Posts: 749

13 December 2019, 9:25

Hi henrythemouse

I'm not able to replicate the problem and that generic error message does not help with diagnosing the problem.

Can I get you to add the changes in https://reviews.mahara.org/#/c/10661/ to your site - they should add to the error message the file and line number that is causing the problem.

If you could do that and paste in the error with file/line number I'll try and workout why it is failing

Cheers

Robert

henrythemouse's profile picture
Posts: 17

13 December 2019, 18:34

Thank you for the quick reply.

I got to thinking and realized that I had introduced modified code and had not tried reverting to the original code before calling for help. My bad, I apologize. I reverted to the original code and the issue of not being able to save/create/use skins disappeared. So that's fixed.

I had replaced HTMLPurifier.php with a version that removed most of the code that actually purified anything because I need to use the <pre> tag in some of my custom pages. For some reason the purifier doesn't like the <pre> tag. I'm not sure what the problem is with the <pre> tag as it's still valid html as far as I know.

Is there anyway I can use the purifier and still be able to use the <pre> tag?

 

TIA

Gary

Robert Lyon's profile picture
Posts: 749

16 December 2019, 9:04

Hi henrythemouse,

I note in places where there is the TinyMCE (wysiwyg) editor the is the option to choose 'preformatted' from the paragraph style dropdown and that saves the <pre> tag as expected.

Which form/field are you using to try and save the <pre> tags?

And are you able to give an example of the markup containing <pre> that is  not saving as expected?

Cheers

Robert

henrythemouse's profile picture
Posts: 17

16 December 2019, 11:40

Robert,

I'm not using TinyMCE to create the data I'm displaying on the page. I'm writing an HTML file off line and then uploading it to my site files. From there I insert the file into the page as a "Some HTML" block. The file contains a block of text within <pre></pre> tags. I find that if I allow HTMLPurifier to do whatever it does, then the contents inside the pre tags will not display (as in a blank page), but if I comment out the purifier function then the content displays as it should. In the past this has not affected creating or editing skins to my recollection (which may not be so good, I've been using mahara for the very early days). I'm not using mahara in the regular sense, I just use it for personal web pages. I find it much easier than writing my own ;-).

My current work around is to have both the modified purifier file and the original present in the HTMLPurifier directory. I copy the original in place when I want to work with skins and then copy the modified purifier in place when I'm done. Once I have the site where I want it, the need for this work around is no longer needed. So, it's not too much of a bother really. I'm just curious why purifier would seemingly block <pre> tags. Are they a security threat or something?

Thanks for you help

 

Kristina Hoeppner's profile picture
Posts: 4717

23 December 2019, 15:47

Hi henrythemouse,

You may take a look at the fix we made a while ago to whitelist more CSS styles. It seems that <pre> is still stripped out / set to "Display: none". I think it would be good to get some more of these allowed and whitelist them properly.

If you'd like to give it a go, you can submit a patch (information on how to connect to code review, please see our documentation). If setting up the connection to code review is too time-consuming at this stage, you can create a new bug and attach the patch there. We will then transfer it to code review. In either case, it would be good if you set up a new bug for the specific fix that you are doing as that helps with tracking the different issues. The tracker item I mentioned above has been released and we do not reopen tracker items that have already been released.

Thank you

Kristina

henrythemouse's profile picture
Posts: 17

02 January 2020, 10:32

I submitted a bug report.

#1858042

7 results