Unable to change default "Underline Links" after upgrade

Hi,

After upgrading from 14.1 to 16.6, links in main area are underlined. As I read from the docs, this can be changed from user preferences. But to change for all users, it is advised to change in XwikiPreferences (see 16.3 how to change default link underline Style? - #7 by pdwalker) but this object does not have a property for “underline links” option.

How this can be done?

Thanks

Hi!
I’m still not sure why there’s no property here. Someone with more knowledge of the migration procedure for XWiki will understand better than me what happens here. I’m the one who introduced the changes and I’m sorry that the migration does not work properly with it.


I think I have a solution. I do not know the exact state of your instance so I cannot ensure you that’d work, but we can at least try :person_shrugging:

I’m pretty sure the actual code to use this preference got properly migrated (right now it just works on a fall back), so all we need to do is add the property you cannot see. It’s not available in the object for some reason so it means that the class did not get updated as expected.

What we can do is add the new field in the XWiki.XWikiPreference class.
If you get to

http://localhost:8080/xwiki/bin/edit/XWiki/XWikiPreferences?editor=class

(change the start of the address with whatever fits your instance ofc) you should have a long list of properties, the first one being Parent Space (parent: String) .

Here, add a new property named underline of the type Static List. Make sure the details of this new property match those:


Most of them can keep the default value, the most important is that you set Values to OnlyInlineLinks|Yes|No.

If you want to be extra careful, you can move the property back up the list of properties, right after the boolean Enable extra accessibility features. At this point, the state of the class should be the exact same as the “expected” one.

Now when you visit http://localhost:8080/xwiki/bin/edit/XWiki/XWikiPreferences?editor=object you should be able to set the value of the object as explained in the topic you referenced and it’ll change the default for all your users.

Let me know how it goes :slight_smile:

Lucas C.

1 Like

That worked.