Handle cases where components are not applied on search folders
authorThierry Florac <tflorac@ulthar.net>
Wed, 13 Jan 2021 14:14:02 +0100
changeset 542 39aef8542b47
parent 541 6209a9579de3
child 543 75d913d682d4
Handle cases where components are not applied on search folders
src/pyams_default_theme/features/search/portlet/templates/search-panels.pt
src/pyams_default_theme/features/search/portlet/templates/search-results.pt
--- a/src/pyams_default_theme/features/search/portlet/templates/search-panels.pt	Tue Jan 12 13:39:51 2021 +0100
+++ b/src/pyams_default_theme/features/search/portlet/templates/search-panels.pt	Wed Jan 13 14:14:02 2021 +0100
@@ -16,7 +16,7 @@
 				 condition="collection">
 			<input type="hidden" name="collection" value="${collection}" />
 		</tal:var>
-		<input type="hidden" name="order_by" value="${request.params.get('order_by') or context.order_by}" />
+		<input type="hidden" name="order_by" value="${request.params.get('order_by') or getattr(context, 'order_by', '')}" />
 		<input type="hidden" name="start" value="${start}" />
 		<input type="hidden" name="length" value="${length}" />
 	</form>
--- a/src/pyams_default_theme/features/search/portlet/templates/search-results.pt	Tue Jan 12 13:39:51 2021 +0100
+++ b/src/pyams_default_theme/features/search/portlet/templates/search-results.pt	Wed Jan 13 14:14:02 2021 +0100
@@ -16,7 +16,7 @@
 				 condition="collection">
 			<input type="hidden" name="collection" value="${collection}" />
 		</tal:var>
-		<input type="hidden" name="order_by" value="${request.params.get('order_by') or context.order_by}" />
+		<input type="hidden" name="order_by" value="${request.params.get('order_by') or getattr(context, 'order_by', '')}" />
 		<input type="hidden" name="start" value="${start}" />
 		<input type="hidden" name="length" value="${length}" />
 	</form>