Active
Project:
DrupalGap
Version:
7.x-1.10
Component:
Module Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
26 Feb 2015 at 13:48 UTC
Updated:
28 Feb 2015 at 03:33 UTC
Jump to comment: Most recent
Nodes are not displaying on my site. I'm trying to debug this but I'm not having much luck.
window.localStorage.clear() enabled.I have made a link to node 1 on my site like this:
content['node1'] = {
theme: 'button_link',
text: 'Node1',
path: 'node/1',
};When I visit the page, I see the title but no node content. To debug further, I tried making the page its own function like this:
function mymodule_node1_page() {
try {
node_load(1, {
success:function(node){
alert("Loaded " + node.title + node.content);
}
});
node_page_view(1);
}
catch (error) { console.log('mymodule_node1_page - ' + error); }
}When I do this, node.title and node.content are displayed correctly in the alert box, but there is no actual content on the page.
How can I debug this further?
Comments
Comment #1
tyler.frankenstein commentedIf you do a GET on ?q=drupalgap/node/123.json, is there a language code reported on the node? If so, is there any matching language code attached to each field on the node? I'm guessing this is a multi-lingual issue. By default DrupalGap tries to use the language code specified on the node, and then uses that language code to load the values of each field. If the field doesn't have that language code defined, it falls back to 'und'.
Comment #2
ptmkenny commentedHere's the result of GET ?q=drupalgap/node/11.json
So it looks like the node has a language of en-US but the body field value is und. I believe this is the standard configuration when using i18n node translation (which I am) instead of entity translation.
I tried accessing the page both with Drupal.settings.language_default set to 'und' and 'en-US', but both times it returns a blank page, although the content is printed to the screen in the alert dialog box after node_load of node.content.