Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
startup problems. drupalgap connection and authentication ok.
http://cleanpatterns.cms/admin/config/services/drupalgap
Following startup drupal 8 docs here:
http://docs.drupalgap.org/8/Hello_World/index
created module >> router and controller created automatically.
URL: http://cleanpatterns.cms/app/#hello-world
result:
deviceready connect failed Arguments0: Error: Network Error
Stack trace:
jDrupal.connect/</c.onerror@http://cleanpatterns.cms/app/jdrupal.min.js:1:4255
callee: function dg.deviceready/</<()length: 1Symbol(Symbol.iterator): undefined__proto__: Object { … } drupalgap.min.js:2:863
TypeError: account is undefined[Learn More] example.js:21:9
here is the unmodified auto-generated code
dg.createModule('example');
example.routing = function() {
var routes = {};
routes['example.foo'] = {
path: '/hello-world',
defaults: {
_title: 'Hello World',
_controller: example.fooController
}
};
return routes;
};
example.fooController = function() {
// Make a greeting for the current user.
var account = dg.currentUser();
var msg = account.isAuthenticated() ?
'Hello ' + account.getAccountName() :
'Hello World';
// Prepare our page's render element.
var element = {};
// Add a message as markup to the render element.
element['my_widget'] = {
_markup: '<p>' + msg + '</p>'
};
// Return the element to be rendered on the page.
return element;
};
Comments
Comment #2
Syntapse CreditAttribution: Syntapse commentedComment #3
Syntapse CreditAttribution: Syntapse commentedok taking a step back, the app is failing to connect...
URL: http://cleanpatterns.cms/app/
Comment #4
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedAre you developing in a browser with a web app right now, or are compiling the application to run on an Android/iOS device?
Either way, we'll want to debug the application with Chrome or Safari (and if you're compiling, connect via USB for Android + Chrome debugging, and connect via USB for iOS + Safari debugging) using their Developer Tools and then the Network/Console tabs.
These should reveal to us the Network call to the jDrupal Connect resource, and also include the Response in the Response tab.
I'm curious what that response looks like.
For reference, here's the line that is failing: https://github.com/signalpoint/DrupalGap/blob/8.x-1.x/src/dg.js#L50
Comment #5
Syntapse CreditAttribution: Syntapse commenteddeveloping in a browser with a web app spun up from the hello world example.
using firefox. is that supported? not recommended?
i can re-test on chrome if you prefer. in the meantime here's the connect call in HAR..
{
"log": {
"version": "1.1",
"creator": {
"name": "Firefox",
"version": "57.0.1"
},
"browser": {
"name": "Firefox",
"version": "57.0.1"
},
"pages": [
{
"startedDateTime": "2018-02-21T14:32:20.698+00:00",
"id": "page_1",
"title": "DrupalGap",
"pageTimings": {
"onContentLoad": -1,
"onLoad": -1
}
}
],
"entries": [
{
"pageref": "page_1",
"startedDateTime": "2018-02-21T14:32:20.698+00:00",
"time": 3,
"request": {
"bodySize": 0,
"method": "GET",
"url": "http://cleanpatterns.cms/app/",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Host",
"value": "cleanpatterns.cms"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
},
{
"name": "Accept",
"value": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
},
{
"name": "Accept-Language",
"value": "en-GB,en;q=0.5"
},
{
"name": "Accept-Encoding",
"value": "gzip, deflate"
},
{
"name": "Cookie",
"value": "SESS1019f45a9eec24343f82bcdef46e90dc=EaO2OyezCDnPkPD8Slgm5b9-PZK4zalgzY1yYv0SKW0"
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "Upgrade-Insecure-Requests",
"value": "1"
},
{
"name": "If-Modified-Since",
"value": "Wed, 21 Feb 2018 10:39:26 GMT"
},
{
"name": "If-None-Match",
"value": "\"4cd-565b68a8c3f26-gzip\""
},
{
"name": "Cache-Control",
"value": "max-age=0"
}
],
"cookies": [],
"queryString": [],
"headersSize": 536
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Date",
"value": "Wed, 21 Feb 2018 14:32:20 GMT"
},
{
"name": "Server",
"value": "Apache/2.4.18 (Ubuntu)"
},
{
"name": "Last-Modified",
"value": "Wed, 21 Feb 2018 10:39:26 GMT"
},
{
"name": "ETag",
"value": "\"4cd-565b68a8c3f26-gzip\""
},
{
"name": "Accept-Ranges",
"value": "bytes"
},
{
"name": "Vary",
"value": "Accept-Encoding"
},
{
"name": "Content-Encoding",
"value": "gzip"
},
{
"name": "Content-Length",
"value": "505"
},
{
"name": "Keep-Alive",
"value": "timeout=5, max=100"
},
{
"name": "Connection",
"value": "Keep-Alive"
},
{
"name": "Content-Type",
"value": "text/html"
}
],
"cookies": [],
"content": {
"mimeType": "text/html",
"size": 1229,
"text": "\n\n\n\n\n \n \n \n\n DrupalGap\n
\n\n
\n
\n
\n
\n\n
\n
\n
\n
\n\n
\n
\n\n\n\n\n
Drupal Gap JS application
\n
\n
\n\n
\n
\n\n
\n
\n drupalgap.start();\n\n\n\n\n"
},
"redirectURL": "",
"headersSize": 337,
"bodySize": 842
},
"cache": {},
"timings": {
"blocked": 1,
"dns": 2,
"connect": 0,
"ssl": 0,
"send": 0,
"wait": 0,
"receive": 0
},
"serverIPAddress": "192.168.1.200",
"connection": "80"
},
{
"pageref": "page_1",
"startedDateTime": "2018-02-21T14:32:21.209+00:00",
"time": 4,
"request": {
"bodySize": 0,
"method": "GET",
"url": "http://cleanpatterns.cms/app/jdrupal.min.js",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Host",
"value": "cleanpatterns.cms"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
},
{
"name": "Accept",
"value": "*/*"
},
{
"name": "Accept-Language",
"value": "en-GB,en;q=0.5"
},
{
"name": "Accept-Encoding",
"value": "gzip, deflate"
},
{
"name": "Referer",
"value": "http://cleanpatterns.cms/app/"
},
{
"name": "Cookie",
"value": "SESS1019f45a9eec24343f82bcdef46e90dc=EaO2OyezCDnPkPD8Slgm5b9-PZK4zalgzY1yYv0SKW0"
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "If-Modified-Since",
"value": "Wed, 21 Feb 2018 10:20:13 GMT"
},
{
"name": "If-None-Match",
"value": "\"38a3-565b645cedaa5-gzip\""
},
{
"name": "Cache-Control",
"value": "max-age=0"
}
],
"cookies": [],
"queryString": [],
"headersSize": 501
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Date",
"value": "Wed, 21 Feb 2018 14:32:21 GMT"
},
{
"name": "Server",
"value": "Apache/2.4.18 (Ubuntu)"
},
{
"name": "Last-Modified",
"value": "Wed, 21 Feb 2018 10:20:13 GMT"
},
{
"name": "ETag",
"value": "\"38a3-565b645cedaa5-gzip\""
},
{
"name": "Accept-Ranges",
"value": "bytes"
},
{
"name": "Vary",
"value": "Accept-Encoding"
},
{
"name": "Content-Encoding",
"value": "gzip"
},
{
"name": "Content-Length",
"value": "3611"
},
{
"name": "Keep-Alive",
"value": "timeout=5, max=99"
},
{
"name": "Connection",
"value": "Keep-Alive"
},
{
"name": "Content-Type",
"value": "application/javascript"
}
],
"cookies": [],
"content": {
"mimeType": "application/javascript",
"size": 14499,
"text": "var jDrupal={};jDrupal.init=function(){jDrupal.csrf_token=!1,jDrupal.sessid=null,jDrupal.modules={},jDrupal.connected=!1,jDrupal.settings={sitePath:null,basePath:\"/\"}},jDrupal.init(),jDrupal.config=function(a){var b=void 0!==arguments[1]?arguments[1]:null;return b?void(jDrupal.settings[a]=b):jDrupal.settings[a]},jDrupal.sitePath=function(){return jDrupal.settings.sitePath},jDrupal.basePath=function(){return jDrupal.settings.basePath},jDrupal.restPath=function(){return this.sitePath()+this.basePath()},jDrupal.path=function(){return this.restPath().substr(this.restPath().indexOf(\"://\")+3).replace(\"localhost\",\"\")},jDrupal.isReady=function(){try{var a=!jDrupal.isEmpty(jDrupal.sitePath());return a||console.log(\"sitePath not set in jdrupal.settings.js\"),a}catch(b){console.log(\"jDrupal.isReady - \"+b)}},jDrupal.isEmpty=function(a){return null!==a&&\"object\"==typeof a?0===Object.keys(a).length:void 0===a||null===a||\"\"==a},jDrupal.functionExists=function(name){return\"function\"==eval(\"typeof \"+name)},jDrupal.inArray=function(a,b){try{if(void 0===b)return!1;if(\"string\"==typeof a)return b.indexOf(a)>-1;for(var c=!1,d=0;d0;b--){var c=Math.floor(Math.random()*(b+1)),d=a[b];a[b]=a[c],a[c]=d}return a},jDrupal.time=function(){var a=new Date;return Math.floor(a/1e3)},jDrupal.lcfirst=function(a){return a+=\"\",a.charAt(0).toLowerCase()+a.substr(1)},jDrupal.ucfirst=function(a){return a+=\"\",a.charAt(0).toUpperCase()+a.substr(1)},jDrupal.Module=function(){this.name=null},jDrupal.moduleExists=function(a){try{return void 0!==jDrupal.modules[a]}catch(b){console.log(\"jDrupal.moduleExists - \"+b)}},jDrupal.moduleImplements=function(a){try{var b=[];if(a)for(var c in jDrupal.modules)jDrupal.modules.hasOwnProperty(c)&&jDrupal.functionExists(c+\"_\"+a)&&b.push(c);return 0!=b.length&&b}catch(d){console.log(\"jDrupal.moduleImplements - \"+d)}},jDrupal.moduleInvoke=function(a,b){if(jDrupal.moduleLoad(a)){var c=a+\"_\"+b;if(jDrupal.functionExists(c)){var d=window[c],e=Array.prototype.slice.call(arguments);return e.splice(0,2),0==Object.getOwnPropertyNames(e).length?d():d.apply(null,e)}}},jDrupal.moduleInvokeAll=function(a){var b=[],c=Array.prototype.slice.call(arguments);c.splice(0,1);var d=[];for(var e in jDrupal.modules)jDrupal.modules.hasOwnProperty(e)&&jDrupal.functionExists(e+\"_\"+a)&&d.push(e);if(jDrupal.isEmpty(d))return Promise.resolve();for(var f=0;f },
"redirectURL": "",
"headersSize": 351,
"bodySize": 3962
},
"cache": {},
"timings": {
"blocked": 3,
"dns": 0,
"connect": 0,
"ssl": 0,
"send": 0,
"wait": 1,
"receive": 0
},
"serverIPAddress": "192.168.1.200",
"connection": "80"
},
{
"pageref": "page_1",
"startedDateTime": "2018-02-21T14:32:21.225+00:00",
"time": 3,
"request": {
"bodySize": 0,
"method": "GET",
"url": "http://cleanpatterns.cms/app/drupalgap.min.js",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Host",
"value": "cleanpatterns.cms"
},
{
"name": "User-Agent",
"value": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0"
},
{
"name": "Accept",
"value": "*/*"
},
{
"name": "Accept-Language",
"value": "en-GB,en;q=0.5"
},
{
"name": "Accept-Encoding",
"value": "gzip, deflate"
},
{
"name": "Referer",
"value": "http://cleanpatterns.cms/app/"
},
{
"name": "Cookie",
"value": "SESS1019f45a9eec24343f82bcdef46e90dc=EaO2OyezCDnPkPD8Slgm5b9-PZK4zalgzY1yYv0SKW0"
},
{
"name": "Connection",
"value": "keep-alive"
},
{
"name": "If-Modified-Since",
"value": "Tue, 13 Feb 2018 20:15:16 GMT"
},
{
"name": "If-None-Match",
"value": "\"f030-5651da7217d00-gzip\""
},
{
"name": "Cache-Control",
"value": "max-age=0"
}
],
"cookies": [],
"queryString": [],
"headersSize": 503
},
"response": {
"status": 200,
"statusText": "OK",
"httpVersion": "HTTP/1.1",
"headers": [
{
"name": "Date",
"value": "Wed, 21 Feb 2018 14:32:21 GMT"
},
{
"name": "Server",
"value": "Apache/2.4.18 (Ubuntu)"
},
{
"name": "Last-Modified",
"value": "Tue, 13 Feb 2018 20:15:16 GMT"
},
{
"name": "ETag",
"value": "\"f030-5651da7217d00-gzip\""
},
{
"name": "Accept-Ranges",
"value": "bytes"
},
{
"name": "Vary",
"value": "Accept-Encoding"
},
{
"name": "Content-Encoding",
"value": "gzip"
},
{
"name": "Content-Length",
"value": "15233"
},
{
"name": "Keep-Alive",
"value": "timeout=5, max=98"
},
{
"name": "Connection",
"value": "Keep-Alive"
},
{
"name": "Content-Type",
"value": "application/javascript"
}
],
"cookies": [],
"content": {
"mimeType": "application/javascript",
"size": 61488,
"text": "/*! drupalgap 2018-02-13 */\nfunction core_rest_pre_process(a,b){dg.spinnerShow()}function core_rest_post_process(a){dg.spinnerHide()}function system_pre_process_route_change(a,b){if(void 0!==b){var c=dg.blocksLoad();for(var d in c)if(c.hasOwnProperty(d)){var e=c[d],f=e.getRegion();f&&f.getHiddenBlocks().length==f.getBlocks().length&&dg.removeBodyClass(\"no-\"+f.get(\"id\"))}}}var dg={activeTheme:null,blocks:null,regions:null,spinner:0,themes:{},_title:\"\",_continued:!1,_postRenderMax:128,_libraries:{},_messages:[]},drupalgap=dg;dg.settings={mode:\"web-app\",front:null,blocks:{}},dg.start=function(){dg.isCompiled()?document.addEventListener(\"deviceready\",dg.deviceready,!1):dg.deviceready()},dg.deviceready=function(){dg.bootstrap(),jDrupal.moduleInvokeAll(\"deviceready\").then(function(){jDrupal.moduleImplements(\"deviceready\")||dg._continued||jDrupal.connect().then(dg.continue,function(){console.log(\"deviceready connect failed\",arguments)})})},dg.bootstrap=function(){dg.router.config({});var a=jDrupal.modulesLoad();for(var b in a)if(a.hasOwnProperty(b)){var c=dg.getModuleRoutes(b);if(c)for(var d in c)if(c.hasOwnProperty(d)){var e=c[d];e.key=d,dg.router.add(e);var f=dg.router.getBaseRoute(e);f&&dg.router.saveAsChildRoute(e,f)}}dg.config(\"front\")||dg.config(\"front\",\"dg\"),dg.themeLoad().then(function(){dg.blocksLoad(),jDrupal.moduleInvokeAll(\"init\").then(function(){dg.router.add(function(){}).listen()})})},dg.continue=function(){dg._continued=!0,dg.router.check(dg.router.getPath())},dg.spinnerShow=function(){dg.spinner++},dg.spinnerHide=function(){dg.spinner--},dg.isArray=function(a){return jDrupal.isArray(a)},dg.isEmpty=function(a){return jDrupal.isEmpty(a)},dg.isInt=function(a){return jDrupal.isInt(a)},dg.salt=function(){return jDrupal.userPassword.apply(this,arguments)},dg.currentUser=function(){return jDrupal.currentUser()},dg.userPassword=function(){return console.log(\"dg.userPassword() is deprecated, use dg.salt() instead.\"),dg.salt.apply(this,arguments)},dg.Block=function(a,b,c,d){for(var e in c)c.hasOwnProperty(e)&&(this[e]=c[e]);for(var f in d)d.hasOwnProperty(f)&&(this[f]=d[f]);this._id||(this._id=b),this._module||(this._module=a),this._format||(this._format=\"div\"),this._before||(this._before=\"\"),this._prefix||(this._prefix=\"\"),this._suffix||(this._suffix=\"\"),this._after||(this._after=\"\"),this._routes||(this._routes=[]),dg.setRenderElementDefaults(this),this._attributes.id||(this._attributes.id=dg.cleanCssIdentifier(b))},dg.Block.prototype.get=function(a){var b=\"_\"+a;return void 0!==this[b]?this[b]:null},dg.Block.prototype.set=function(a,b){this[\"_\"+a]=b},dg.Block.prototype.getRegion=function(){return dg.regions?dg.regions[this.get(\"region\")]:null},dg.Block.prototype.buildWrapper=function(){var a=this;return new Promise(function(b,c){a.build().then(function(c){dg.setRenderElementDefaults(c),jDrupal.moduleInvokeAll(\"block_view_alter\",c,a).then(function(){a.set(\"content\",c),b(a)})})})},dg.Block.prototype.render=function(){var a=dg.cleanCssIdentifier(this.get(\"id\")),b=document.getElementById(a),c=dg.render(this.get(\"content\"));b?b.innerHTML=c:setTimeout(function(a){var b=document.getElementById(a);b&&(b.innerHTML=c)},1,a)},dg.Block.prototype.build=function(){return new Promise(function(a,b){a(\"\")})},dg.Block.prototype.getVisibility=function(){var a=this,b=dg.currentUser();return new Promise(function(c,d){var e=!0,f=function(){c({visible:e,block:a})},g=a.get(\"access\");if(g)return e=g.call(),void f();var h=a.get(\"roles\");if(h){e=!1;for(var i=0;i=0;c--)if(b[c]===a){b.splice(c,1);break}},dg.setTitle=function(a,b,c){void 0===b&&(b=!0),void 0===c&&(c=!0),a=a||\"\",\"object\"==typeof a&&(a=a._title?a._title:\"\"),dg._title=a,b&&dg.setDocumentTitle(a),c&&dg.setPageTitle(a)},dg.getDocumentTitle=function(){return document.title},dg.setDocumentTitle=function(a){a=a||dg.config(\"title\"),document.title=dg.theme(\"document_title\",{_title:dg.t(a)})},dg.setPageTitle=function(a){var b=document.getElementById(\"title\");b&&(b.innerHTML=\"string\"==typeof a?dg.theme(\"title\",{_title:a}):dg.render(a))},dg.attrs=function(a){var b=a._attributes;return b?dg.attributes(b):\"\"},dg.attributes=function(a){var b=\"\";if(a)for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];Array.isArray(d)&&d.length?b+=c+'=\"'+d.join(\" \")+'\" ':null===d?b+=\" \"+c+\" \":\"\"!=d?b+=c+'=\"'+d+'\" ':\"class\"!=c&&(b+=c+\" \")}return b},dg.attributesInit=function(a){var b=a._attributes?a._attributes:{};b.class?\"string\"==typeof b.class&&(b.class=[b.class]):b.class=[],a._attributes=b},dg.setVar=function(a,b){window.localStorage.setItem(a,JSON.stringify(b))},dg.getVar=function(a,b){var c=JSON.parse(window.localStorage.getItem(a));return null===c&&void 0!==b?(dg.setVar(a,b),b):c},dg.deleteVar=function(a){return window.localStorage.removeItem(a)},dg.applyToConstructor=function(a,b){var c=[null].concat(b);return new(a.bind.apply(a,c))},dg.cleanCssIdentifier=function(a){return a.replace(/_/g,\"-\").toLowerCase()},dg.getCamelCase=function(a){return a.replace(/[-_]([a-z])/g,function(a){return a[1].toUpperCase()})},dg.extend=function(a,b){for(var c in b)if(b.hasOwnProperty(c)){var d=b[c];jDrupal.isEmpty(d)||(a[c]=d)}return a},dg.killCamelCase=function(a,b){return b||(b=\"-\"),jDrupal.lcfirst(a).replace(/([A-Z])/g,b+\"$1\").toLowerCase()},dg.inArray=function(a,b){return jDrupal.inArray(a,b)},dg.imagePath=function(a){var b=dg.restPath()+a;return-1!=b.indexOf(\"public://\")?b=b.replace(\"public://\",dg.config(\"files\").publicPath+\"/\"):-1!=b.indexOf(\"private://\")&&(b=b.replace(\"private://\",dg.config(\"files\").privatePath+\"/\")),b},dg.elementAttributesInit=function(a){dg.attributesInit(a)},dg.b=function(a,b){return b||(b={}),b._value||(b._value=a),dg.theme(\"button\",b)},dg.l=function(a,b,c){return c||(c={}),c._text||(c._text=a),c._path||(c._path=b),dg.theme(\"link\",c)},dg.bl=function(a,b,c){return this.l.apply(this,arguments)},dg.removeElement=function(a){var b=dg.qs(\"#\"+a);b&&b.parentElement.removeChild(b)},dg.t=function(a,b,c){if(b)for(var d in b)b.hasOwnProperty(d)&&(a=a.replace(d,b[d]));return a},dg.formatPlural=function(a,b,c){return 1==parseInt(a)?b:c},dg.Node=function(a){return new jDrupal.Node(a)},dg.entityController=function(a){var b={};return b.entity={_theme:\"bucket\",_grab:function(){var b=dg.router.getActiveRoute(),c=b.defaults._entity_type,d=dg.getCamelCase(c)+\"Load\";return new Promise(function(c,e){dg[d](a).then(function(a){b.defaults._handler(a,c,e)})})}},b},dg.forms={},dg.theme_form=function(a){var b=\"\";a._id||(b=\"missing _id\");var c=window[a._id];if(c||(b=\"form id not found: \"+a._id),\"\"!=b)return console.log(\"dg.theme_form - \"+b),\"\";var d=dg.killCamelCase(a._id,\"-\");return a._attributes.id=\"form-wrapper-\"+d,dg.render({_markup:\"
\",_postRender:[function(){var b=dg.addForm(a._id,dg.applyToConstructor(c));b.getForm(a).then(function(c){dg.qs(\"#\"+a._attributes.id).innerHTML=c,dg.formHasActions(b.form)&&dg.formAttachSubmissionHandler(d),dg.runPostRenders()})}]})},dg.formDomIdFromId=function(a){return dg.killCamelCase(a,\"-\").toLowerCase()},dg.Form=function(a){this.id=a,this.form={_attributes:{id:dg.formDomIdFromId(a),class:[]},_validate:[a+\".validateForm\"],_submit:[a+\".submitForm\"],_after_build:[]},this.form_state=new dg.FormStateInterface(this),this.elements={}},dg.Form.prototype.get=function(a){return void 0!==this[a]?this[a]:null},dg.Form.prototype.getFormId=function(){return this.get(\"id\")},dg.Form.prototype.getFormDomId=function(){return dg.formDomIdFromId(this.getFormId())},dg.Form.prototype.getForm=function(){var a=this,b=arguments;return new Promise(function(c,d){var e=function(){for(name in a.form)if(dg.isFormElement(name,a.form)){var b=a.form[name];if(\"actions\"==b._type){dg.setFormElementDefaults(name,b);for(_name in b)dg.isFormElement(_name,b)&&dg.setFormElementDefaults(_name,b[_name])}else dg.setFormElementDefaults(name,b)}var d=jDrupal.moduleInvokeAll(\"form_alter\",a.form,a.getFormState(),a.getFormId()),e=function(){for(var b in a.form)if(dg.isFormElement(b,a.form)){var d=a.form[b];switch(d._type||(d._type=\"markup\"),d._widgetType||(d._widgetType=\"FormElement\"),d._widgetType){case\"FieldWidget\":case\"FormWidget\":var e=a.form._entity.get(b),f=0,g=new dg.modules[d._module][d._widgetType][d._type](a.form._entityType,a.form._bundle,b,d,e,f);if(a.elements[b]=g,g.form(e,f,d,a.form,a.form_state),\"hidden\"==d._type){a.form[b]=d;continue}var h={};d._title&&(h.label={_theme:\"form_element_label\",_title:d._title}),h.element=d;var i={_theme:\"container\",_children:h,_weight:d._weight};a.form[b]=i;break;case\"FormElement\":default:var j=d._widgetType;if(d._type){var k=jDrupal.ucfirst(dg.getCamelCase(d._type))+\"Element\";dg[k]&&(j=k)}var l=new dg[j](b,d,a);if(a.elements[b]=l,jDrupal.inArray(d._type,[\"hidden\",\"markup\"]))continue;var h={_attributes:{class:[]}};d._title&&!d._attributes.placeholder&&(\"checkbox\"==d._type||(h.label={_theme:\"form_element_label\",_title:d._title,_attributes:{class:[],for:d._attributes.id}})),h.element=l;var i={_theme:\"container\",_children:h,_attributes:{class:[]},_weight:d._weight};a.form[b]=i}}for(var m=[],n=0;n \"+dg.render(a.form)+\"
\")})};d?d.then(e):e()};if(b.length){for(var f=[a.form,a.form_state],g=0;g\"+a._title+\"\"},dg.theme_actions=function(a){var b=\"\";for(prop in a)dg.isFormElement(prop,a)&&(b+=dg.render(a[prop]));return b},dg.theme_checkbox=function(a){a._attributes.type=\"checkbox\",a._attributes.id||(a._attributes.id=\"checkbox-\"+dg.salt()),a._default_value&&(a._attributes.checked=\"checked\");var b=a._title?' '+a._title+\"\":\"\",c=a._prefix?a._prefix:\"\",d=a._suffix?a._suffix:\"\";return c+\"\"+b+d},dg.theme_checkboxes=function(a){var b=\"\";for(var c in a._options)if(a._options.hasOwnProperty(c)){var d=a._options[c],e=\"object\"!=typeof d?{_title:jDrupal.isEmpty(d)?c:d}:d;e._attributes||(e._attributes={}),void 0===e._attributes.value&&(e._attributes.value=c),a._default_value&&a._default_value[c]&&(e._default_value=a._default_value[c]),b+=dg.theme(\"checkbox\",e)+\"
\"+b+\"
\"}return\"
\"},dg.theme_email=function(a){return a._attributes.type=\"email\",\"\"},dg.theme_hidden=function(a){return a._attributes.type=\"hidden\",\"\"},dg.theme_number=function(a){return a._attributes.type=\"number\",\"\"},dg.theme_password=function(a){return a._attributes.type=\"password\",\"\"},dg.theme_radio=function(a){a._attributes.type=\"radio\";var b=a._title?a._title:null,c=a._title_attributes?a._title_attributes:{};c.for||(c.for=a._attributes.id);var d=\"\";return b&&(d+=\"\"+b+\"\"),d},dg.theme_radios=function(a){var b=\"\";for(var c in a._options)if(a._options.hasOwnProperty(c)){var d=a._options[c],e={_title:jDrupal.isEmpty(d)?c:d,_attributes:{value:c,name:a._attributes.name}};a._default_value==c&&(e._attributes.checked=\"checked\"),b+=\"
\"}return\"
\"},dg.theme_select=function(a){var b=\"\";if(a._options)for(var c in a._options)if(a._options.hasOwnProperty(c)){var d=a._options[c];if(\"object\"==typeof d)void 0!==a._value&&a._value==c&&(d._attributes.selected=\"\"),b+=dg.render(d);else{var e=\"\";void 0!==a._value&&a._value==c&&(e=\" selected \"),b+='\"+d+\"\"}}return\"
\"+b+\"
\"},dg.theme_submit=function(a){return a._attributes.type=\"submit\",!a._attributes.value&&a._value&&(a._attributes.value=a._value),\"\"},dg.theme_textarea=function(a){var b=a._value?a._value:\"\";return\"\"+b+\"\"},dg.theme_textfield=function(a){return a._attributes.type=\"text\",\"\"},dg.FormStateInterface=function(a){this.form=a,this.values={},this.errors={}},dg.FormStateInterface.prototype.get=function(a){return void 0!==this[a]?this[a]:null},dg.FormStateInterface.prototype.set=function(a,b){this[a]=b},dg.FormStateInterface.prototype.setFormState=function(){var a=this,b=a.get(\"form\"),c=[];for(var d in b.elements)\"actions\"!=d&&\"markup\"!=b.elements[d].element._type&&c.push(b.elements[d].valueCallback());return Promise.all(c).then(function(b){for(var c=0;c\"+e.get(\"prefix\");for(var h=0;h\"+i.get(\"after\")}d+=e.get(\"suffix\")+\"\"+e.get(\"after\")}}d+=dg.render(a),document.getElementById(\"dg-app\").innerHTML=d,window.scrollTo(0,0);var k=dg.blocksLoad(),l=[],m=function(a){var b=a.getRegion();if(b.getBlocks().length==b.getHiddenBlocks().length){var c=b.get(\"id\");dg.removeElement(dg.cleanCssIdentifier(c)),dg.addBodyClass(\"no-\"+c)}if(l.splice(l.indexOf(a.get(\"id\")),1),0==l.length){dg.runPostRenders();var d=dg.loadForms();for(var e in d)d.hasOwnProperty(e)&&dg.formAttachSubmissionHandler(e)}};for(c in k)k.hasOwnProperty(c)&&(l.push(c),k[c].getVisibility().then(function(a){if(a.visible)a.block.buildWrapper().then(function(a){a.render(),m(a)});else{var b=a.block,c=b.get(\"id\");dg.regions[b.get(\"region\")].addHiddenBlock(c),dg.removeElement(dg.cleanCssIdentifier(c)),m(a.block)}}))}),f=function(){var a={};for(var b in dg.regions)if(dg.regions.hasOwnProperty(b))for(var c=dg.regions[b].getBlocks(),d=0;d\",_postRender:[function(){dg.addAttachments(a).then(function(){var b=document.getElementById(f);a._attached.onload&&setTimeout(a._attached.onload,1),delete a._attached,b.outerHTML=dg.render(a,!0)})}]},!0)}a.markup&&(console.log('Use \"_markup\" instead of \"markup\" in:',a),a._markup=a.markup);var h=a._prefix?a._prefix:\"\",i=a._suffix?a._suffix:\"\";if(dg.isObject(h)&&(h=dg.render(h)),dg.isObject(i)&&(i=dg.render(i)),dg.isUndefined(a._postRender)&&(a._postRender=[]),a._markup)return dg.prepPostRenders(a),b&&setTimeout(dg.runPostRenders,1),h+a._markup+i;var j=!!a._theme,k=!!a._type;if(j||k){var l=h+dg.theme(j?a._theme:a._type,a)+i;return dg.prepPostRenders(a),l}var m=null,n={},o=0;d+=h;for(var p in a)if(a.hasOwnProperty(p)&&!jDrupal.inArray(p,dg.renderProperties())){var q=a[p],r=typeof q;if(\"object\"===r&&null!==q)m=void 0!==q._weight?q._weight:0,dg.isUndefined(n[m])&&(n[m]=[]),n[m].push(dg.render(q)),o++;else if(\"array\"===r)for(var s=0;s
Comment #6
Syntapse CreditAttribution: Syntapse commented....and the network response tab for REST call to
https://www.cleanpatterns.cms/jdrupal/connect?_format=json
from URL
http://cleanpatterns.cms/app/
is empty
Comment #7
tyler.frankenstein CreditAttribution: tyler.frankenstein commentedI notice in the logs there that it is referring to both "www.cleanpatterns.cms" and "cleanpatterns.cms", this could cause an issue.
If you have your sitePath set with the www in your settings.js file, then it's necessary to access the app with the www in the url too. If you don't use the www, then the browser might consider that "cross domain" and deny the request.
Alternatively, you can use this dynamic sitePath value and it should work with and without the www:
Using Firefox is fine. No matter what browser it is though, get in the habit of holding down SHIFT when clicking the refresh button, and that should force the browser to download the latest of everything (e.g. settings.js).
Also, in your previous comment, please use the "code" formatting button to wrap all your debug output, so it is easier to skim over, it's difficult to do on the flat white background with no indentations.