• Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Medium Medium
    • None
    • 2.7.2, 5.2
    • None

      Panels do not recognize hex code to set color:

      Try the following code:

      {panel:title=*Test Panel*| borderStyle=solid| borderColor=#ccc| titleBGColor=#DOD9BD| bgColor=#F5F7F1}
      
      This is testing
      
      {panel}
      
      

      This will return the error : "panel: Color value is invalid"

      This work fine in Confluence 2.5.7

        1. error-in-2-7-2.jpg
          12 kB
          Fennie Ng [Atlassian]
        2. Fine-in-2-5-7.jpg
          9 kB
          Fennie Ng [Atlassian]

            [CONFSERVER-10951] panel: Color value is invalid

            Hi There

            Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement. Rather than leave this here I'm going to close this issue as won't fix. I believe that this better reflects the status of the issue.

            Regards
            Steve Haffenden
            Confluence Bugmaster

            Steve Haffenden (Inactive) added a comment - Hi There Thanks for taking the time to raise this issue. As you are no doubt aware this issue has been on our backlog for some time now with very little movement. Rather than leave this here I'm going to close this issue as won't fix. I believe that this better reflects the status of the issue. Regards Steve Haffenden Confluence Bugmaster

            Don Willis added a comment -

            Hi AP,

            This bug is not scheduled for a fix soon. No patch is currently available. I suggest you ask your users to report and fix the pages where panels have been created with invalid colours. I think you will find they are relatively rare, unless, as is the case for Sean, the broken panels are being created by some automated process, or by copy and paste from other code. If either of those is the case then you should be able to run a query similar to the one I suggested for Sean, since the broken colour will always be the same.

            Cheers,
            Don

            Don Willis added a comment - Hi AP, This bug is not scheduled for a fix soon. No patch is currently available. I suggest you ask your users to report and fix the pages where panels have been created with invalid colours. I think you will find they are relatively rare, unless, as is the case for Sean, the broken panels are being created by some automated process, or by copy and paste from other code. If either of those is the case then you should be able to run a query similar to the one I suggested for Sean, since the broken colour will always be the same. Cheers, Don

            Hi Don,
            We have just upgraded to confluence 2.7.3 and are also having the same issue.We have lots of pages with panel. So we cannot go to each one of them to check if or not they have used the right color.

            Would it be possible for you to provide us with the patch that you were talking about above which would log the error instead of spewing it to the user and the user in such case would see the default color.

            If so please also let us know when is the earlist that we can get the patch.

            Thanks and Regards
            Wiki-Support (AP)

            Cisco IT Wiki Support added a comment - Hi Don, We have just upgraded to confluence 2.7.3 and are also having the same issue.We have lots of pages with panel. So we cannot go to each one of them to check if or not they have used the right color. Would it be possible for you to provide us with the patch that you were talking about above which would log the error instead of spewing it to the user and the user in such case would see the default color. If so please also let us know when is the earlist that we can get the patch. Thanks and Regards Wiki-Support (AP)

            Don Willis added a comment -

            Hi Sean,

            The query is pretty simple really. Having said that, I've tested it on a single Oracle 10g database, so this is hardly production code. Please try it on a backup database first. It will change the text in any content in your Confluence instance, which might not always be what you want. Eg if you've written pages about this issue then they will be affected and may make little sense afterwards. You could expand the query to specify which space you want to update content for, or to only update 'current' content, or just content on pages.

            update bodycontent set body = replace(body, 'titleBGColor=#DOD9BD', 'titleBGColor=#D0D9BD') where instr(body, 'titleBGColor=#DOD9BD') > 0;
            

            The where clause isn't technically necessary, but it means you know how many rows were changed.

            Cheers,
            Don

            Don Willis added a comment - Hi Sean, The query is pretty simple really. Having said that, I've tested it on a single Oracle 10g database, so this is hardly production code. Please try it on a backup database first. It will change the text in any content in your Confluence instance, which might not always be what you want. Eg if you've written pages about this issue then they will be affected and may make little sense afterwards. You could expand the query to specify which space you want to update content for, or to only update 'current' content, or just content on pages. update bodycontent set body = replace (body, 'titleBGColor=#DOD9BD' , 'titleBGColor=#D0D9BD' ) where instr(body, 'titleBGColor=#DOD9BD' ) > 0; The where clause isn't technically necessary, but it means you know how many rows were changed. Cheers, Don

            Hi Don, When I say "worked" I mean that even though the color wasn't valid the panel would still display a color. And yes, indeed these pages were created from a template. We're using Oracle 10g as our backend. I'd love to have a sql script we could run against it to fix these. Thanks! Sean

            Sean Semone added a comment - Hi Don, When I say "worked" I mean that even though the color wasn't valid the panel would still display a color. And yes, indeed these pages were created from a template. We're using Oracle 10g as our backend. I'd love to have a sql script we could run against it to fix these. Thanks! Sean

            Don Willis added a comment -

            Sean, when you say "and it just worked"? Do you mean by "worked", that it displayed in the default gray colour?
            I'm surprised that you would have "hundreds" of pages where people typed in an invalid colour.
            Was it generated from a template with the mistake in it or something? If that were the case then presumably the invalid colour would be the same on pretty much all the errors and you could do a DB search and replace to correct it globally. If that's an acceptable workaround tell me and I'll come up with the query for you. (I'd need to know what DB you use. Search and replace in SQL isn't well standardized).

            If you've got an extremely large number of pages, so that the small percentage of pages with this problem is still "hundreds", I could give you a one-off patch to log the error instead of spewing it to the user. This would mean that somebody could track the errors in the log and update them over time. Hopefully they'd be all gone by the next upgrade, which might be incompatible with the patch.

            Chuck, thanks for the confirmation on reporting the invalid colour.

            Cheers,
            Don

            Don Willis added a comment - Sean, when you say "and it just worked"? Do you mean by "worked", that it displayed in the default gray colour? I'm surprised that you would have "hundreds" of pages where people typed in an invalid colour. Was it generated from a template with the mistake in it or something? If that were the case then presumably the invalid colour would be the same on pretty much all the errors and you could do a DB search and replace to correct it globally. If that's an acceptable workaround tell me and I'll come up with the query for you. (I'd need to know what DB you use. Search and replace in SQL isn't well standardized). If you've got an extremely large number of pages, so that the small percentage of pages with this problem is still "hundreds", I could give you a one-off patch to log the error instead of spewing it to the user. This would mean that somebody could track the errors in the log and update them over time. Hopefully they'd be all gone by the next upgrade, which might be incompatible with the patch. Chuck, thanks for the confirmation on reporting the invalid colour. Cheers, Don

            I don't have as many pages as Sean so we are ok with fixing the bad hex values in the markup as we find them during testing. I do think it would be helpful to include the color that was considered invalid in the error message.

            Chuck White added a comment - I don't have as many pages as Sean so we are ok with fixing the bad hex values in the markup as we find them during testing. I do think it would be helpful to include the color that was considered invalid in the error message.

            The users that we support were happy when they could enter whatever color they wanted and it just worked. Indeed we have hundreds of pages (more perhaps) that have this error since our upgrade. Fixing them all manually is going to be quite tedious and not thought of well by our users. Suggestions?

            Sean Semone added a comment - The users that we support were happy when they could enter whatever color they wanted and it just worked. Indeed we have hundreds of pages (more perhaps) that have this error since our upgrade. Fixing them all manually is going to be quite tedious and not thought of well by our users. Suggestions?

            Don Willis added a comment -

            As Ming Giet points out, the example wiki markup genuinely is in error. The error message is unfortunately quite vague, in that it doesn't point out which colour is broken. (Not to mention the error message being in US English.)

            Would those who've encountered this 'bug' be happy if we fixed the error message so that it specifies which colour is incorrect? This would make the errors easier to correct. Are people finding that they have so many of these errors that fixing them is a difficult task?

            Don Willis added a comment - As Ming Giet points out, the example wiki markup genuinely is in error. The error message is unfortunately quite vague, in that it doesn't point out which colour is broken. (Not to mention the error message being in US English.) Would those who've encountered this 'bug' be happy if we fixed the error message so that it specifies which colour is incorrect? This would make the errors easier to correct. Are people finding that they have so many of these errors that fixing them is a difficult task?

            This is an improvement introduced in Confluence 2.7.x whereby the panel macro will return a meaningful error message when invalid color value is defined. You might want to check with the color values as having 'O' (for orange) in hex value is illegal/invalid. You can only have letters A-F and numbers 0-9 in the hex value. Hence, I would suggest you try changing the valid hex value to see if it helps. You might want to try the following example:

            {panel:title=*Test Panel*| borderStyle=solid| borderColor=#ccc| titleBGColor=#D0D9BD| bgColor=#F5F7F1}
            This is testing
            {panel}
            

            Ming Giet Chong [Atlassian] added a comment - This is an improvement introduced in Confluence 2.7.x whereby the panel macro will return a meaningful error message when invalid color value is defined. You might want to check with the color values as having 'O' (for orange) in hex value is illegal/invalid. You can only have letters A-F and numbers 0-9 in the hex value. Hence, I would suggest you try changing the valid hex value to see if it helps. You might want to try the following example: {panel:title=*Test Panel*| borderStyle=solid| borderColor=#ccc| titleBGColor=#D0D9BD| bgColor=#F5F7F1} This is testing {panel}

              Unassigned Unassigned
              fng Fennie Ng [Atlassian]
              Affected customers:
              4 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: