Logo not being replaced properly

I’m trying to change the logo that appears on the login page. After uploading an image, it will change it to “Wiki Logo” text instead of the actual expected image. Only the ‘Default’ image works. Any tips?

Log when pressing Save on either Default or my uploaded logo.png:

2019-03-14 23:40:11,581 [http://xwiki.contoso.com:8080/xwiki/bin/preview/XWiki/DefaultSkin] WARN m.i.DefaultJMXBeanRegistration - Failed to unregister resource with name [type=Velocity,domain=Engines,name=xwiki:XWiki.DefaultSkin^XWiki.XWikiSkins[0].logo]. Reason = [MalformedObjectNameException: Invalid character ‘:’ in value part of property]

xwiki_logo_issue

Debian 11.1/postgresql11

Steps:

  1. Administer Wiki
  2. Look & Feel > Themes
  3. Skin > Customize (Default XWiki Skin)
  4. Edit this skin
  5. Choose an attachment
  6. Upload and select logo.png
  7. Save

Expected results: Image of logo.png
Results: Text “Wiki Logo”

Maybe your image format is not supported. You could try with another image. Also make sure you can add attachments in wiki pages.

Hey vmassol,

Thanks for your help as always.

The same logo is used in the Charcoal theme and works fine and the upload attachment works in general. I tried uploading a jpg instead of png and it’s still having the same issue. I can see the images when I select them on the Skin setting (image below) but it won’t appear in on the login page.

xwiki_logo_issue2

I don’t know why the JMX server sends this error (never seen it). What servlet container are you using and in what version?

Note: The URL shows a preview action, not a save one.

The first screenshot you show is really weird, the URL is all messed up.

Could you attach your logo so that I can try it locally?

Thanks

Also what version of XWiki is this? 11.1?

Correct! Vers 11.1 using the single button apt-get installation with tomcat8. This is a new install that I imported an older 7.2 xar into. I imported just the pages, charcoal theme, and Admin account. I did not import the skin over or the logo attachment.

You’re right with the weird. The Image urls:

Default:
http://xwiki.contoso.com:8080/xwiki/skins/flamingo/logo.svg?cache-version=1551116415000

images.png:
http://xwiki.contoso.com:8080/xwiki/bin/login/XWiki/XWikiLogin?srid=0KJqyH6r&xredirect=%2Fxwiki%2Fbin%2Fskin%2FXWiki%2FDefaultSkin%2Fimages.png%3Fsrid%3D0KJqyH6r

images

This suggest the browser is redirected when it try to access the logo because the user does not have view right on the XWiki.DefaultSkin page.

I gave rights to the groups but still seems to give the same URL. Am I assigning the permissions in the right location?
xwiki_logo_issue3

Looks like it yes.

Is the user with the problem part of XWikiAllGroup ? Do you get that issue with an admin user ? Can you access this page with the user ?

I’ve tried logging in as superadmin, admin, a regular user and the page loads when going to http://xwiki.contoso.com:8080/xwiki/bin/view/XWiki/DefaultSkin.

Users are in the XWikiAllGroup. I also have this in the config: xwiki.authentication.group.allgroupimplicit=1

xwiki_logo_issue5

Strange, I was playing around with it and fixed it with these steps:

  1. Change theme from Charcoal (an imported theme from xar) to Cerulean.
  2. Log out and properly see the uploaded image.
  3. Log back in as Admin and change theme back to Charcoal.
  4. Log out and can still see the uploaded image.

I appreciate the help. Been struggling with this migration for awhile :slight_smile:

Spoke too soon. It was just cached. Image still broken :frowning:

I just deleted the database and started over thinking it maybe due to my imported xar. I can confirm it is not.

I played around more with permissions and noticed two things on the brand new database:

  1. That if any of these red boxes are NOT checked. Login page will use the Theme “Iceberg” selected. Custom logo works.
  2. If it is checked, it will use the Skin instead of theme, “XWiki.DefaultSkin”. Custom logo will be broken.

xwiki_logo_issue6

I do would like to however, keep from unregistered users from seeing the site so I do need XWikiDefaultSkin logo working :frowning:

Ok I fixed this by going through the code for anyone else having the same issues:

Note this is for debian tomcat8-postgresql11 setup. Requires server side permissions. This will change the theme’s logo (if different) as well. Change value of the logoname.png.

  1. Upload png file to directory: /usr/lib/xwiki/resources/icons/xwiki

  2. Open vm file and copy contents: /usr/lib/xwiki/skins/flamingo/companylogo.vm

  3. Administer Wiki > Look & Feel > Themes > Customize XWiki.DefaultSkin > Overridden template: companylogo.vm > Add

  4. Paste the companylogo.vm contents over.

  5. Look for "<img src="$!logourl" alt="Wiki Logo"/>"

  6. Modify to <img src="$xwiki.getSkinFile(‘icons/xwiki/NEWLOGO.png’)" alt=“Wiki Logo”/>

  7. Save