Skip to content

Commit

Permalink
fix title issue in assembly api (#462)
Browse files Browse the repository at this point in the history
  • Loading branch information
xdavidson authored Oct 30, 2020
1 parent 4387fef commit 13cf3b3
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import com.redhat.pantheon.model.module.ModuleVersion;
import com.redhat.pantheon.servlet.AbstractJsonSingleQueryServlet;
import com.redhat.pantheon.servlet.ServletUtils;
import com.redhat.pantheon.servlet.util.ServletHelper;
import com.redhat.pantheon.servlet.util.SlingPathSuffix;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.resource.Resource;
Expand Down Expand Up @@ -201,7 +202,10 @@ protected Map<String, Object> resourceToMap(@Nonnull SlingHttpServletRequest req
.variants().get()
.canonicalVariant().get();
moduleMap.put("canonical_uuid", canonical.uuid().get());
moduleMap.put("title", page.title().get());
// Get the current title from module instead of using the stored value in the content node
// When module title is modified, the value stored in content node becomes stale.
// Sometime, the title stored in content node shows filename instead of title.
moduleMap.put("title", ServletHelper.getModuleTitleFromUuid(canonical));
moduleMap.put("module_uuid", module.uuid().get());
// check if the module is published
if (canonical.released().isPresent() && System.getenv(PANTHEON_HOST) != null) {
Expand Down

0 comments on commit 13cf3b3

Please sign in to comment.