Commit 6295d0e4 authored by Sven Franck's avatar Sven Franck

only query JIO if a page requires a portal_type to be queried

parent 354997b6
......@@ -338,7 +338,6 @@
}
// TODO: Make generic handler for this
if (item[property] === "") {
console.log("ribbon")
obj.ribbon = true;
}
if ((split.length > 1 && window.location.host !== host) ||
......@@ -1759,7 +1758,6 @@
}
);
if (props.ribbon) {
console.log("ribbon");
ribbon_wrap = factory.generateElement(
"span",
{"className":"ribbon-wrapper"}
......@@ -3837,6 +3835,9 @@
// add validation to all forms
for (j = 0; j < form_list.length; j += 1) {
form_element = form_list[j];
// console.log("foo, we have a form")
//
// console.log(form_element);
if (form_element.getAttribute("data-bound") === null) {
form_element.setAttribute("data-bound", true);
......@@ -3995,7 +3996,8 @@
if (reply.response) {
baggage.fields = util.parseIfNeeded(reply.response);
}
if (baggage.create !== false) {
if (baggage.create !== false && baggage.config.initial_query) {
return init.testForSampleData({
"storage": "items",
"type": baggage.type,
......@@ -4070,11 +4072,13 @@
} else {
baggage.state = {};
baggage.state.method = baggage.constructor;
baggage.state.query = init.generateQueryObject({}, baggage.type);
if (baggage.config.initial_query) {
baggage.state.query = init.generateQueryObject({}, baggage.type);
}
}
// skip total for single item layouts!
// TODO: What if the first page should only contain an object?
if (baggage.layout_level === 0) {
if (baggage.layout_level === 0 && baggage.config.initial_query) {
return util.fetchData({
"baggage": baggage,
"storage": "items",
......@@ -4116,7 +4120,7 @@
);
}
// new item, no query!
if (baggage.mode) {
if (baggage.mode || baggage.config.initial_query === undefined) {
return {
"baggage": baggage
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment