Search code examples
liferay-6liferay-theme

Liferay - Attribute "configurable" must be declared for element type "setting" Exception


Trying to setup a theme settings in Liferay 6.2.1 CE & EE. My liferay-look-and-feel.xml looks like:

<?xml version="1.0"?>
<!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 6.0.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_6_0_0.dtd">

<look-and-feel>
    <compatibility>
        <version>6.2.0+</version>
    </compatibility>
    <theme id="wwhs-login-theme" name="wwhs-login-theme" >
        <settings>
            <setting type="select" configurable="true" 
                key="choose-login-theme-wwhs" 
                options="client-operations-login-theme,client-experience-login-theme" 

                value="client-experience-login-theme" ></setting>
        </settings>
    </theme>    
</look-and-feel>

When I try to build it, getting the below error:

07:48:57,413 ERROR [localhost-startStop-2][ThemeLocalServiceImpl:268] com.liferay.portal.kernel.xml.DocumentException: Error on line 10 of document : Attribute "configurable" must be declared for element type "setting". Nested exception: Attribute "configurable" must be declared for element type "setting".

What am I missing?


Solution

  • Found an answer. This error is due to the wrong DOCTYPE configuration.

    <!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 6.0.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_6_0_0.dtd">
    

    needs to be changed to

    <!DOCTYPE look-and-feel PUBLIC "-//Liferay//DTD Look and Feel 6.2.0//EN" "http://www.liferay.com/dtd/liferay-look-and-feel_6_2_0.dtd">
    

    The 6.0.0 DTD File doesn't have the configurable (and additional) attribute which have been added in later versions.

    Ref: http://www.liferay.com/community/forums/-/message_boards/message/16388636