cwrc / Islandora-CWRC-Writer

Islandora wrapper for the CWRC-Writer.
https://github.com/cwrc/CWRC-Writer
GNU General Public License v3.0
0 stars 3 forks source link

Hard-coded server name #30

Open jefferya opened 6 years ago

jefferya commented 6 years ago

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:

ilovan commented 6 years ago

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

ajmacdonald commented 6 years ago

@ilovan @jefferya should be fixed https://github.com/cwrc/Islandora-CWRC-Writer/commit/bdc1290aa0d658db1dfbe4ba907b25dd9ac94cee but needs deployment

ilovan commented 6 years ago

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 commented 6 years ago

@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 https://github.com/cwrc/Islandora-CWRC-Writer/blob/bdc1290aa0d658db1dfbe4ba907b25dd9ac94cee/js/cwrc_entity_lookup.js#L48

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 commented 6 years ago

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

jefferya commented 6 years ago

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

ajmacdonald commented 6 years ago

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

ajmacdonald commented 6 years ago

Fixed and deployed on dev-06 https://github.com/cwrc/CWRC-WriterBase/commit/79cb0fa1770d4018f2085266265a59d99f2facce

ilovan commented 6 years ago

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 commented 6 years ago

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

ilovan commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

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 commented 6 years ago

@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 commented 5 years ago

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 commented 5 years ago

https://github.com/cwrc/Islandora-CWRC-Writer/commit/0cc69e8034024e630842d1aa802d1566bf28e59f

ilovan commented 5 years ago

@ajmacdonald , this issue is similar, but in the entity forms repository: https://github.com/cwrc/cwrc-entity-management-forms-static/issues/57