Moodle
  1. Moodle
  2. MDL-34916

customized small logo not showing up in Formal White theme

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.3.1
    • Fix Version/s: 2.2.6, 2.3.3
    • Component/s: Themes
    • Labels:
    • Testing Instructions:
      Hide

      switch to FW
      go to Site administration -> Appearance -> Themes -> Formal white
      Change:
      Custom logo to "pix/moodlelogo.gif"
      Custom front page logo to "pix/moodlelogo.gif"
      (this picture is supposed to be always available in your moodle installation)
      Save.

      Now browse the moodle front page and some other moodle pages.
      Each page should display the moodlelogo.gif image in its header.

      Show
      switch to FW go to Site administration -> Appearance -> Themes -> Formal white Change: Custom logo to "pix/moodlelogo.gif" Custom front page logo to "pix/moodlelogo.gif" (this picture is supposed to be always available in your moodle installation) Save. Now browse the moodle front page and some other moodle pages. Each page should display the moodlelogo.gif image in its header.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-34916_master

      Description

      Customized logo in formal_white theme works as expected. It's a 600x100 jpg.
      But small logo doesn't show up. It's a 300x50 jpg (just the previous one scaled).
      I've tried with png equivalents with the same issue.
      May be it's not a bug but both worked fine in version 1.9 and I haven't been able to find a report like this.
      Thank you
      Rafel

        Gliffy Diagrams

          Activity

          Hide
          Mary Evans added a comment -

          I guess you are aware that Moodle caches all data? As a result you will not see any changes to images if you have been modifying the theme without first enabling 'Theme Designer Mode' in Settings > Site Administration > Appearance > Theme settings.

          Show
          Mary Evans added a comment - I guess you are aware that Moodle caches all data? As a result you will not see any changes to images if you have been modifying the theme without first enabling 'Theme Designer Mode' in Settings > Site Administration > Appearance > Theme settings.
          Hide
          Rafel Tricas added a comment -

          Yes, yes, thank you. But it doesn't work.
          I've tried many combinations even using the standard small logo like it was customized. The only way to keep it working is leaving the variable 'customlogourl' empty.
          The bigger logo in front page acts as expected.
          Rafel

          Show
          Rafel Tricas added a comment - Yes, yes, thank you. But it doesn't work. I've tried many combinations even using the standard small logo like it was customized. The only way to keep it working is leaving the variable 'customlogourl' empty. The bigger logo in front page acts as expected. Rafel
          Hide
          Mary Evans added a comment -

          I don't think this is a BUG, I think it is because you are trying to do something other than add the logo via Formal White's custom settings page, which is the preferred way.

          This discussion should really be in the Themes forum.
          http://moodle.org/mod/forum/view.php?id=46

          However, just so that I have things clear about what, and how you are doing whatever it is, that is not working. Can you please write some simple steps, that describe how you arrived at the problem, so that I can try and recreate the same? I need to know what the images are called and how you are trying to make them work. For instance, have you changed any code in the layout files etc.

          Thanks

          Show
          Mary Evans added a comment - I don't think this is a BUG, I think it is because you are trying to do something other than add the logo via Formal White's custom settings page, which is the preferred way. This discussion should really be in the Themes forum. http://moodle.org/mod/forum/view.php?id=46 However, just so that I have things clear about what, and how you are doing whatever it is, that is not working. Can you please write some simple steps, that describe how you arrived at the problem, so that I can try and recreate the same? I need to know what the images are called and how you are trying to make them work. For instance, have you changed any code in the layout files etc. Thanks
          Hide
          Rafel Tricas added a comment -

          Sorry if I put this in a wrong place! Of course you can change anything you think is better.
          I haven't changed any code at all.
          Can you check this, please?
          Go to: Site administration -> Appearance -> Themes -> Formal white
          Change:
          Custom logo: "theme/formal_white/pix/logo_small.png"
          Custom front page logo: "theme/formal_white/pix/logo.png"
          When I do this, even using the standard logos provided, it doesn't work for me.
          I can see the front page logo but not the small one.
          You can see what happens here:
          http://tricas.net/moodle
          Just trying to log in or open the public course.
          Thank you,
          Rafel

          Show
          Rafel Tricas added a comment - Sorry if I put this in a wrong place! Of course you can change anything you think is better. I haven't changed any code at all. Can you check this, please? Go to: Site administration -> Appearance -> Themes -> Formal white Change: Custom logo: "theme/formal_white/pix/logo_small.png" Custom front page logo: "theme/formal_white/pix/logo.png" When I do this, even using the standard logos provided, it doesn't work for me. I can see the front page logo but not the small one. You can see what happens here: http://tricas.net/moodle Just trying to log in or open the public course. Thank you, Rafel
          Hide
          Mary Evans added a comment -

          Ah...I see now what you have done.
          You need to add the FULL url like this...

          http://tricas.net/moodle23/theme/formal_white/pix/matepetit.jpg

          Just adding

          theme/formal_white/pix/matepetit.jpg

          does not work

          Show
          Mary Evans added a comment - Ah...I see now what you have done. You need to add the FULL url like this... http://tricas.net/moodle23/theme/formal_white/pix/matepetit.jpg Just adding theme/formal_white/pix/matepetit.jpg does not work
          Hide
          Mary Evans added a comment - - edited

          @Daniele,

          Can you please verify that the small logo will only appear if the FULL url is given and not just

          theme/formal_white/pix/logo_small.png

          Thanks
          Mary

          Show
          Mary Evans added a comment - - edited @Daniele, Can you please verify that the small logo will only appear if the FULL url is given and not just theme/formal_white/pix/logo_small.png Thanks Mary
          Hide
          Rafel Tricas added a comment -

          You are right!
          I always try to write links as relative as possible. That makes things much easier in case of having to migrate, a site or something.
          Wonder why the front panel logo works without the full url but the small one doesn't.
          Ok, many thanks!
          Rafel

          Show
          Rafel Tricas added a comment - You are right! I always try to write links as relative as possible. That makes things much easier in case of having to migrate, a site or something. Wonder why the front panel logo works without the full url but the small one doesn't. Ok, many thanks! Rafel
          Hide
          Mary Evans added a comment -

          The fact is that the main LOGO works with relative URL and the small Logo works only with absolute URL is probably a BUG!

          I'll get Daniele to look at this and see if he can make the small logo URL setting relative too.

          Thanks for reporting this.

          Show
          Mary Evans added a comment - The fact is that the main LOGO works with relative URL and the small Logo works only with absolute URL is probably a BUG! I'll get Daniele to look at this and see if he can make the small logo URL setting relative too. Thanks for reporting this.
          Hide
          Daniele Cordella added a comment -

          Ciao and thanks Mary and Rafael.
          I tried to have a look at this issue.
          Fine, cool, thanks but...
          1st: am I wrong or what you pointed out is a general working way of each theme?
          2nd: here a relative path does not work in secondary moodle pages as far as in the front page too. Am I wrong?

          Before closing: I am far from my computer. I can find (more or less) a way to read the tracker to continue this chat but I will fix this issue as soon as September start.

          Show
          Daniele Cordella added a comment - Ciao and thanks Mary and Rafael. I tried to have a look at this issue. Fine, cool, thanks but... 1st: am I wrong or what you pointed out is a general working way of each theme? 2nd: here a relative path does not work in secondary moodle pages as far as in the front page too. Am I wrong? Before closing: I am far from my computer. I can find (more or less) a way to read the tracker to continue this chat but I will fix this issue as soon as September start.
          Hide
          Daniele Cordella added a comment -

          @Mary
          if you find my solution correct, please carry on this issue even if I am far.
          I postet a draft solution in
          https://github.com/kordan/moodle/compare/master...MDL-34916_master.
          It did not publish it because I prefer waiting for your reply.
          But if all is fine and I am still far... you are welcome to close this issue without me too.

          @Rafael: if you are in hurry and if you find my solution is correct for you... just copy it.

          Ciao.

          Show
          Daniele Cordella added a comment - @Mary if you find my solution correct, please carry on this issue even if I am far. I postet a draft solution in https://github.com/kordan/moodle/compare/master...MDL-34916_master . It did not publish it because I prefer waiting for your reply. But if all is fine and I am still far... you are welcome to close this issue without me too. @Rafael: if you are in hurry and if you find my solution is correct for you... just copy it. Ciao.
          Hide
          Mary Evans added a comment -

          Thanks Danielle,
          I've set it for Integration.

          Have a nice holiday!

          Show
          Mary Evans added a comment - Thanks Danielle, I've set it for Integration. Have a nice holiday!
          Hide
          Mary Evans added a comment -

          @Danielle
          I have just tested without the fix and the relative URL works OK...I am not sure why it did not do that for Rafel.

          I have closed this as it is not a BUG.

          Thanks for quick response.
          Mary

          Show
          Mary Evans added a comment - @Danielle I have just tested without the fix and the relative URL works OK...I am not sure why it did not do that for Rafel. I have closed this as it is not a BUG. Thanks for quick response. Mary
          Hide
          Daniele Cordella added a comment -

          @Mary: I am sorry Mary but as I already wrote: I can confirm the problem here exists for main front page logo and for all secundary pages both. I can not understand why Rafael sees it only for secundary pages and why you can not reproduce it at all.

          – Posted from Bugbox for iPhone

          Show
          Daniele Cordella added a comment - @Mary: I am sorry Mary but as I already wrote: I can confirm the problem here exists for main front page logo and for all secundary pages both. I can not understand why Rafael sees it only for secundary pages and why you can not reproduce it at all. – Posted from Bugbox for iPhone
          Hide
          Mary Evans added a comment -

          In that case Daniele, I will re-opened this and await your return from holiday in September.
          Thanks

          Show
          Mary Evans added a comment - In that case Daniele, I will re-opened this and await your return from holiday in September. Thanks
          Hide
          Daniele Cordella added a comment -

          Rafel, any comment from your side? Is the proposed fix working for you? Do you confim the issue exists only for secundary pages?

          – Posted from Bugbox for iPhone

          Show
          Daniele Cordella added a comment - Rafel, any comment from your side? Is the proposed fix working for you? Do you confim the issue exists only for secundary pages? – Posted from Bugbox for iPhone
          Hide
          Rafel Tricas added a comment -

          Mary and Daniele,
          I've been trying to figure out why it happened only for the small logo without success. Probably there is something weird related to the web browser... who knows?
          Mary: Finally I think you were right, I don't think it's a bug either
          Daniele: Your code works perfect! Excellent idea!
          And I've tried this and it works well too:
          if (!stristr($logourl, $CFG->wwwroot)) {
          $logourl = $CFG->wwwroot.'/'.$logourl;
          Many thanks to both of you
          Rafel

          Show
          Rafel Tricas added a comment - Mary and Daniele, I've been trying to figure out why it happened only for the small logo without success. Probably there is something weird related to the web browser... who knows? Mary: Finally I think you were right, I don't think it's a bug either Daniele: Your code works perfect! Excellent idea! And I've tried this and it works well too: if (!stristr($logourl, $CFG->wwwroot)) { $logourl = $CFG->wwwroot.'/'.$logourl; Many thanks to both of you Rafel
          Hide
          Daniele Cordella added a comment - - edited

          I am getting crazy with this issue.
          Just a minute to explain the reasons.
          First: I reproduced the issue reported by Rafel. Thanks, Rafel!
          Second: I made a bit of hacking to understand if something was different in the logo management between homepage and other pages... but with no luck.
          Third: I copied the source code of a course page (Command-U in firefox for Mac to let you better understand, Alt-Command-U in Chrome for Mac) and pasted it to a text document. I called it eee.html ('e' like error) and I saved it in the moodle root.
          I went to look for what part of the code forces the logo not to be shown

          What I found is:

          http://localhost/HEAD/course/view.php?id=6 does not show the page header logo
          http://localhost/HEAD/eee.html [with exactly the same html code] does perfectly show the page header logo.
          The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same

          I purged the cache, I changed the web browser, I disabled JS but... nothing changed.
          Please help me!
          Any hint?

          Show
          Daniele Cordella added a comment - - edited I am getting crazy with this issue. Just a minute to explain the reasons. First: I reproduced the issue reported by Rafel. Thanks, Rafel! Second: I made a bit of hacking to understand if something was different in the logo management between homepage and other pages... but with no luck. Third: I copied the source code of a course page (Command-U in firefox for Mac to let you better understand, Alt-Command-U in Chrome for Mac) and pasted it to a text document. I called it eee.html ('e' like error) and I saved it in the moodle root. I went to look for what part of the code forces the logo not to be shown What I found is: http://localhost/HEAD/course/view.php?id=6 does not show the page header logo http://localhost/HEAD/eee.html [with exactly the same html code] does perfectly show the page header logo. The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same - The two sources are exactly the same I purged the cache, I changed the web browser, I disabled JS but... nothing changed. Please help me! Any hint?
          Hide
          Daniele Cordella added a comment -

          Ok, finally the fix is here.
          Two words to explain the issue.
          The custom header image is handled exactly in the same way in EACH moodle template in the frame of formal_white.
          In spite of this, the custom header image appear in the moodle front page and NOT in each other pages. This is correct because of the relative path of the picture.
          The moodle front page URL is: moodle/index.php so the relative path of the picture is interpreted as: "moodle/" + "theme/formal_white/pix/logo_small.png" (as in the test proposed by Mary) that is correct.
          In all other pages the URL is different (it is, for instance, "moodle/admin/settings.php") so the relative path of the picture is interpreted as: "moodle/admin/" + "theme/formal_white/pix/logo_small.png" and this is wrong.
          At this point I strongly believe my first proposal of solution is the right one.

          Show
          Daniele Cordella added a comment - Ok, finally the fix is here. Two words to explain the issue. The custom header image is handled exactly in the same way in EACH moodle template in the frame of formal_white. In spite of this, the custom header image appear in the moodle front page and NOT in each other pages. This is correct because of the relative path of the picture. The moodle front page URL is: moodle/index.php so the relative path of the picture is interpreted as: "moodle/" + "theme/formal_white/pix/logo_small.png" (as in the test proposed by Mary) that is correct. In all other pages the URL is different (it is, for instance, "moodle/admin/settings.php") so the relative path of the picture is interpreted as: "moodle/admin/" + "theme/formal_white/pix/logo_small.png" and this is wrong. At this point I strongly believe my first proposal of solution is the right one.
          Hide
          Daniele Cordella added a comment -

          I wonder why <base> metatag is not present in moodle header! Am I wrong?

          Show
          Daniele Cordella added a comment - I wonder why <base> metatag is not present in moodle header! Am I wrong?
          Hide
          Andrea Bicciolo added a comment -

          Hi Daniele,
          just applied your patch and according to testing instructions the logo now seems working. Some considerations:

          • please consider backporting to 2.2 as it is supported
          • since now Formal White supports full URLs as well as relative paths, the theme settings descritive texts could be updated as well, adding examples of full log URL (already present) and a relativhe logo path as well (currently missing)
          Show
          Andrea Bicciolo added a comment - Hi Daniele, just applied your patch and according to testing instructions the logo now seems working. Some considerations: please consider backporting to 2.2 as it is supported since now Formal White supports full URLs as well as relative paths, the theme settings descritive texts could be updated as well, adding examples of full log URL (already present) and a relativhe logo path as well (currently missing)
          Hide
          Daniele Cordella added a comment -

          Cool Andrea.
          I added the fix for M22 and M23.
          I believe we need one more issue to address the need to change strings.

          Show
          Daniele Cordella added a comment - Cool Andrea. I added the fix for M22 and M23. I believe we need one more issue to address the need to change strings.
          Hide
          Andrea Bicciolo added a comment -

          Submitted for integration review

          Show
          Andrea Bicciolo added a comment - Submitted for integration review
          Hide
          Daniele Cordella added a comment -

          @Rafel: ok, fix has been developed but... maybe a path like http://localhost/path/to/your/logo.png was enough to preserve site migration.

          Show
          Daniele Cordella added a comment - @Rafel: ok, fix has been developed but... maybe a path like http://localhost/path/to/your/logo.png was enough to preserve site migration.
          Hide
          Rafel Tricas added a comment - - edited

          Daniele: Relative paths make things easier in case of migration, for instance, from one shared hosting to another.
          Even if you want to change the domain you don't have to worry.

          Show
          Rafel Tricas added a comment - - edited Daniele: Relative paths make things easier in case of migration, for instance, from one shared hosting to another. Even if you want to change the domain you don't have to worry.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          Daniele Cordella added a comment -

          > ...if you want to change the domain you don't have to worry.
          @Rafel: sure, I agree with you. But http://localhost/any/relative/path/image.png is enough to preserve site migration. Isn't it?

          Show
          Daniele Cordella added a comment - > ...if you want to change the domain you don't have to worry. @Rafel: sure, I agree with you. But http://localhost/any/relative/path/image.png is enough to preserve site migration. Isn't it?
          Hide
          Rafel Tricas added a comment -

          This doesn't seem to work for me.
          Anyway I'd rather choose your codding solution.

          Show
          Rafel Tricas added a comment - This doesn't seem to work for me. Anyway I'd rather choose your codding solution.
          Hide
          Sam Hemelryk added a comment -

          Thanks Daniele, this has been integrated now

          Show
          Sam Hemelryk added a comment - Thanks Daniele, this has been integrated now
          Hide
          Rossiani Wijaya added a comment -

          This works great.

          Test passed.

          Show
          Rossiani Wijaya added a comment - This works great. Test passed.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Gutta cavat lapidem, non vi sed saepe cadendo - Ovidio

          This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads).

          Thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Gutta cavat lapidem, non vi sed saepe cadendo - Ovidio This issue has been integrated upstream and is now available both via git and cvs (and in some hours, via mirrors and downloads). Thanks!

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: