For the custom theme that is used in the application that I'm working on, an Application Level Substitution string was created. You can define these substitution strings at the application level, available from the application home page.APEX 4.2, the first early adapter site in which the described bug is still present. Maybe with the final version of APEX 4.2 that this bug is resolved,.. just wait and see. For this example I will use the sample application. On page one, create a button - I created a "Page Item Button" and named it "P1_TEST".
When you want to use a custom image, located in your custom folder, you might want to use the substitution sting in the src attribute when defining the image. Simply specify the substitution string using the ampersand-dot notation (&MY_LOCATION.) followed by the name of the image that you want to use. Normally this should be sufficient for it to work.
Unfortunately the image will be shown as broken on the page. It turns out that the substitution string doesn't get substituted at all. You can see this when you inspect the HTML code. The following screenshot shows what the src attribute will look like when you use the substitution string in your image definition for the button.
The solution, or I should say the workaround, is as follows: Instead of entering just the substitution string followed by the name of the image, enter the built-in substitution string #IMAGE_PREFIX# before you enter your substitution string:
What can you learn from the screenshot above? Not that the image is still broken, but you can see that the src attribute for the image does have the substitution string value in it, just like you would expect it to have.The Bug
This bug was confirmed by Anthony Rayner with bug number 14197492, and he showed the workaround proposed in this article in a short twitter message.