Affects Version/s: 7.0.X, Master
Component/s: ~[Archived] WCM
Steps to reproduce:
1. Clone the Liferay Blade Samples project:
2. Modify liferay-blade-samples\maven\themes\template-context-contributor\src\main\java\com\liferay\blade\samples\theme\contributor\BladeTemplateContextContributor.java:
With this, we want to make the injected variable (sample_text) available for non-theme templates (like ADT's, web content templates, etc).
3. Build the full maven/ project:
4. Get a Liferay DXP bundle and start it.
5. Add the Blade basic-api artifact to you Liferay bundle:
6. Deploy the generated template context contributor module jar from the target folder:
7. Log in as admin.
8. Create and asset publisher ADT adt1 in the default Liferay site, and put in it a line something like:
9. In the Content section of the default Liferay site, Manage Templates, and modify the Basic Web Content template by adding a similar line to it.
10. Create two additional pages in the site, put an asset publisher on one (and configure it to use the adt1 template), and put a Web Content Display portlet on the other page.
11. Create a basic web content and publish it, then configure the WCD portlet to show this article.
Result: The page with the asset publisher works fine and the value of the sample-text variable ("This is some sample text") is visible in the portlet, while the WCD portlet fails to render, with error:
The following has evaluated to null or missing:
==> sample_text in template "20116#20152#BASIC-WEB-CONTENT" at line 1, column 27
You can see the full stack trace in the Tomcat console.