Closed (fixed)
Project:
DrupalGap
Version:
8.x-1.0-alpha4
Component:
Module Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
31 Aug 2017 at 23:12 UTC
Updated:
27 Dec 2017 at 10:30 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
mcmulman commentedComment #3
mcmulman commentedComment #4
mcmulman commentedComment #5
tyler.frankenstein commentedHello @mcmulman, thank you for reporting this. My apologies for the delay in response.
In your DrupalGap folder, open the settings.js file and set the value for jDrupal.settings.sitePath to https://www.example.com , I need to improve the DrupalGap installation to auto set this value for developers, otherwise this problem will continue for other newcomers.Comment #6
tyler.frankenstein commentedDrupal 8.4.0
Please disregard comment #5, I went in and reminded myself after a few months/years as to how this all works in Drupal 8...
We already have in place a mechanism for auto reporting the Drupal url to the jDrupal sitePath variable during the DrupalGap connection test on admin/config/services/drupalgap , take a look at the connection-test.js file in DrupalGap:
http://cgit.drupalcode.org/drupalgap/tree/js/connection-test.js?h=8.x-1.x
I'd recommend adding this the top of the connection-test.js file:
console.log(drupalSettings)We're specifically looking for the value
drupalSettings.path.baseUrl, which should be (AFAIK) provided automatically by Drupal.What does your
drupalSettingsobject look like in the console log?Comment #7
mandarmbhagwat78 commentedI am facing similar issue https://www.drupal.org/node/2917619
Drupal core: 8.4.0
DrupalGap: 8.x-1.0-alpha1
I found that DrupalGap SDK installation is missing.
Also in drupalgap/scripts/install file below code is commented which is not creating settings.js file.
Also I still could not see below permissions:
1. Access GET on Content resource : Anonymous user, Authenticated user
2. Access POST on Content resource : Authenticated user
2. Access PATCH on Content resource : Authenticated user
2. Access DELETE on Content resource : Authenticated user
Comment #8
tyler.frankenstein commentedAt first I thought the DrupalGap Connection Test screen needed a full SDK install and a settings.js file and a properly set sitePath in it to run. But after reviewing the code, the DrupalGap Connection Test page gets the Drupal URL from the drupalSettings object and goes from there by just utilizing jDrupal to make a connection test. So the install script technically has nothing to do with the connection test page, as it was an old school attempt of mine to make the SDK installable with one terminal command.
For now, if you are using the SDK, just copy the default.settings.js file into a settings.js file then set the sitePath variable in the jDrupal.settings object.
It sounds like those permissions have been removed upstream, I will need to update the DrupalGap docs.
Comment #9
zak.schlemmer commentedI am also experiencing this issue
drupal 8.4.0
dg 8.x-1.0-alpha1
when outputting drupalSettings to console log I see a baseURL value of "/"
Everything within the app works without issue, possibly due to the sitePath value being set within settings.js
Comment #10
tyler.frankenstein commented@zak, are you on a localhost environment? If so, what's your full url to the Drupal 8 site?
On this connection test page in DrupalGap, there is no settings.js file being loaded, and instead we're attempting to dynamically determine the
sitePathusing the value ofbaseUrlwithindrupalSettings.path, see here: http://cgit.drupalcode.org/drupalgap/tree/js/connection-test.js?h=8.x-1.xFrom recollection, the baseUrl contained the domain for me, but I will go and verify that now.
UPDATE: On https://demo.drupalgap.org/8/drupal/ (which is the URL to the Drupal 8 site that powers the DrupalGap 8 demo via a LAMP stack (via Ubuntu 16.04). The
baseUrlis reported as/8/drupal/, and then jDrupal is able to make the GET call to https://demo.drupalgap.org/8/drupal/jdrupal/connect?_format=json .I wonder what it is about other environments that are preventing the domain from being included in the GET call here..
Comment #12
tyler.frankenstein commentedPlease download the latest dev snapshot of this module to see if it resolves the issue. It should now work better on a variety of environments.
Comment #13
zak.schlemmer commentedI can confirm that has resolved the issue for me.
Thanks!
Comment #14
tyler.frankenstein commentedComment #15
mandarmbhagwat78 commentedThanks @tyler.frankenstein.....alpha2 version resolved the issue. :)
Comment #17
tt12 commentedI'm having same issue with 8.x-1.0-alpha4 and drupal 8.4.3. Drupal site is on pantheon.io hosting
sdk is intalled manually
settings.js in app folder - ok
sitepath is set.
On Connection test - not found error.
In Console i have 2 errors:
1 Failed to load resource: the server responded with a status of 404 (Not Found)
http://dev-sitename.pantheonsite.io/jdrupal/connect?_format=json
or
GET http://dev-sitename.pantheonsite.io/jdrupal/connect?_format=json 404 (Not Found)
2 Uncaught (in promise) Error: Not Found
at XMLHttpRequest.c.onload (js_B_wcdTihtWukzNG4i4_g8cu9Yt6-JBiqBVO3rgv9R0w.js:701)
But the Path seems to be good..
Do you see where can be the problem, please?
Comment #18
tt12 commentedComment #19
mandarmbhagwat78 commentedHi @tt12,
Did you enable "jQuery Connect" web service with required settings? Check attached screenshot for reference.
Comment #20
tt12 commentedHi @mandarmbhagwat79! Thank you very much - that resolved the problem!
(I just followed docs.drupalgap.org but zapped the readme file)