Notifications

1032 views

Description

When invoking the Calgary version of the UI Macro 'catalog_search_results' from a dynamic content block, no results are displayed. This UI Macro was rewritten to replace obsolete packages calls. When using the old Berlin version from the same dynamic content block, it does display results.
  • The Calgary version of the UI Macro is failing to set the variable jvar_printed_some to true
  • Inside the Calgary version of the UI Macro, at line 50, there is an if statement which fails on the first condition - jvar_print_section == true, and because this fails jvar_printed_some is not set to true
  • The jvar_print_section variable is set by an evaluate Jelly block at line 45, but that is only set if jvar_passed_check has been set to true, and that is set by logic up in lines 22 to 35
  • It looks like both the jvar_passed_check and the jvar_print_section variables are being set by calls to java
---- GlideappCatalogItem.get(item.sys_id).getFirstAccessibleCategoryForSearch(); is called in the logic to set jvar_passed_check.
---- GlideappCatalogItem.get(item.sys_id).canViewOnSearch(); is called in the logic to set jvar_print_section.

Steps to Reproduce

  1. Create a dynamic content block with a hard-coded query that will produce results and that calls the catalog_search_results UI Macro to display the results.
    NOTE:  You can import the attached content_block_programmatic_4ed5f49669fa6400962a4ed9d02e7a62.xml file. It contains the test catalog search results content block, with a hard-coded text search for catalog items with the word 'email.'
  2. Navigate to Content Management > Pages.
  3. Select the Portal - Search Results record.
  4. Click the Edit Page related link.
  5. Click the Add Content link.
  6. Add the test catalog search results content block to the form above the existing Portal - Content Column Common block.
  7. Go to the ESS page.
  8. In the global search box, type junk and click the search icon.
    The Portal - Search Results page is displayed and the content block shows the message: 
    Your search for the word 'email' did not match any documents.
  9. Navigate to the UI Macro named catalog_search_results.
  10. Delete the UI macro.
  11. Import XML the Berlin version of the macro (also attached).
  12. Perform a cache flush (this might not be needed, but it will not hurt).
  13. Go to the ESS page.
  14. In the global search box, type junk and click the search icon
    The Portal - Search Results page is displayed and the content block shows several catalog records that match the word 'email.'

Workaround

If an upgrade is not possible, and no customization is present, the contents of the dynamic content block can be replaced with:

<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
  <j:set var="sysparm_search" value="${RP.getParameterValue('sysparm_search')}"/>
  <g:catalog_find_macro/>
</j:jelly>

The only alternative, if customization is required, is to copy the contents of the UI Macro catalog_find_macro and personalize it.


Related Problem: PRB595186

Seen In

Calgary Patch 3 Hot Fix 1
Dublin EA 7

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2016-05-30 11:07:42
Published:2014-12-09