Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hard-coded server name #30

Open
jefferya opened this issue May 10, 2018 · 17 comments
Open

Hard-coded server name #30

jefferya opened this issue May 10, 2018 · 17 comments
Assignees

Comments

@jefferya
Copy link
Collaborator

Value should be pulled from module's config setting that are passed form Drupal into JS property- Drupal.settings.CWRCWriter.cwrcApiUrl

https://github.com/cwrc/Islandora-CWRC-Writer/blob/master/js/app.js#L4

To reproduce:

  • edit document
  • add title
  • JS console reports error indicating use of cwrc-dev-06 on beta.cwrc.ca due the the hard-coded server name - no CWRC search results.
@ilovan
Copy link
Contributor

ilovan commented May 10, 2018

This is what's causing the CWRC lookups to fail - you just beat me to posting about it, @jefferya and also dug up the cause.

@ajmacdonald , can you please look into this before #29 (I'll add it to the top of you "in progress" pile

@ilovan ilovan assigned ajmacdonald and unassigned ilovan May 10, 2018
@ajmacdonald
Copy link
Collaborator

@ilovan @jefferya should be fixed bdc1290 but needs deployment

@ilovan
Copy link
Contributor

ilovan commented May 11, 2018

you mean it's not been deployed to dev-06 yet, @ajmacdonald ?

If so, please do it as soon as possible, as Brad will need to pull it into the code for beta.

@ajmacdonald
Copy link
Collaborator

@ilovan @jefferya @bradklaver does it need to be deployed on dev-06 before beta? If so, this code won't work because the value returned by Drupal.settings.CWRCWriter.cwrcDialogs.cwrcApiUrl on dev-06 is structured a bit differently than on beta.

dev-06 lookup is https://cwrc-dev-06.srv.ualberta.ca/islandora/cwrc_entities/v1/search/person but the cwrcApiUrl is https://cwrc-dev-06.srv.ualberta.ca/cwrc/api and therefore won't work properly with

return `${urlRoot}/search/${methodName}?query=${encodeURIComponent(queryString)}&limit=100&page=0`;

On beta the lookup is https://beta.cwrc.ca/islandora/cwrc_entities/v1/search/person and the cwrcApiUrl value is https://beta.cwrc.ca/islandora/cwrc_entities/v1

@ilovan
Copy link
Contributor

ilovan commented May 11, 2018

I'll let @jefferya and @bradklaver weigh in on that one.

@jefferya
Copy link
Collaborator Author

@ajmacdonald @ilovan - Config on cwrc-dev-06 using the default - changed to mirror beta.cwrc.ca. Does this change help?

@ajmacdonald
Copy link
Collaborator

@ilovan @jefferya yes that helps. I just updated dev-06 with that change and some others. Unfortunately, one of the other changes ( cwrc/CWRC-WriterBase#93 (comment) ) caused some css conflicts which is messing up how the structure tree gets rendered. I'm working on resolving that now.

@ajmacdonald
Copy link
Collaborator

Fixed and deployed on dev-06 cwrc/CWRC-WriterBase@79cb0fa

@ilovan
Copy link
Contributor

ilovan commented May 14, 2018

Great, thanks, @ajmacdonald .
Can you let us know what is the commit @bradklaver would need to pull into the version of CWRC-Writer on Beta to fix the CWRC entity lookups (not returning any results at the moment)

@ajmacdonald
Copy link
Collaborator

@ilovan @bradklaver the latest version up here is the one to use: 4a6a4bb

@ilovan
Copy link
Contributor

ilovan commented Jun 13, 2018

@ajmacdonald , this seems to work now on Beta, but not on dev-06 : can you look into it? From what Jeff was saying, the same code should work on both beta and dev-06 now.

@ajmacdonald
Copy link
Collaborator

@ilovan It's trying to get the entity from commons.cwrc.ca, which redirects to beta.cwrc.ca, so that's why it works on beta.
@jefferya Is there an alternative to commons.cwrc.ca that we can use on dev-06? And if so, is it available in some Drupal settings that I can reference, like e.g. https://github.com/cwrc/Islandora-CWRC-Writer/blob/master/js/app.js#L5

@jefferya
Copy link
Collaborator Author

Could try:

In the config, admin/islandora/tools/cwrc-writer, there's Repository Base Object URL - change to {server_name}/islandora/object (maybe a slash at the is required). I think this is how this config parameter was meant to function @ajmacdonald @ilovan

@ajmacdonald
Copy link
Collaborator

@jefferya I tried setting it (it was previously blank) but couldn't see any changes reflected in the js global Drupal.settings.CWRCWriter config object

@ajmacdonald
Copy link
Collaborator

I'm taking a look at this again on dev-02. I changed the Repository Base Object URL at https://dev-02.cwrc.ca/admin/islandora/tools/cwrc-writer to https://dev-02.cwrc.ca/islandora/object. This successfully changed the value of Drupal.settings.CWRCWriter.cwrcDialogs.repositoryBaseObjectUrl in the js global config object.

It should be noted that to see the changed value, clearing the Drupal cache was required, using the drush cc all command.

In the descriptive/help text for Repository Base Object URL it states "Note a trailing slash is needed if not using the default." However, the code I've written to make use of this value assumes that there is no trailing slash. @jefferya do you know if this value is used anywhere else?

@ajmacdonald
Copy link
Collaborator

0cc69e8

@ilovan
Copy link
Contributor

ilovan commented Aug 8, 2019

@ajmacdonald , this issue is similar, but in the entity forms repository: cwrc/cwrc-entity-management-forms-static#57

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants