Bug #5954

command line bulk export - URLs exporting incorrectly

Added by Tim Hutchinson over 8 years ago. Updated about 7 years ago.

Status:VerifiedStart date:11/12/2013
Priority:HighDue date:
Assignee:Dan Gillean% Done:

0%

Category:Import/Export
Target version:Release 2.2.0
Google Code Legacy ID: Tested version:2.0.0, 2.0.1, 2.2
Sponsored:No Requires documentation:

Description

When exporting XML via the command line (2.x), the server name is not rendered correctly - we get "symfony" instead. E.g.:

<eadid identifier="legacy ID 11881" countrycode="CA" mainagencycode="CA-SCNUSA" url="http://symfony/symfony/heart-disease-research" encodinganalog="identifier">Photograph Collection, A-10223</eadid> 
...
<dao linktype="simple" href="http://symfony/uploads/r/university-of-saskatchewan-archives/7/4/747103/A-10223_141.jpg" role="reference" actuate="onRequest" show="embed"/>

I didn't notice this until trying to re-import descriptions with links to digital objects - the job fails with an error like "couldn't resolve symfony".

Everything works correctly via the user interface.

Current 2.x build: 7bbac63dae8d89e2e0f150fe226407f39834cf6c

baseURL-setting.png - Set an application-wide base url, to be used to rout around Symfony! (15.2 KB) Dan Gillean, 09/10/2014 03:05 PM


Related issues

Related to Access to Memory (AtoM) - Bug #7437: Site base URL problems Verified 10/27/2014
Related to Access to Memory (AtoM) - Bug #7466: Default value for "base site URL" on installation gives v... Verified 11/04/2014

History

#1 Updated by Tim Hutchinson over 8 years ago

Arggh, the EAD tags didn't come through. Hopefully this is clear enough...

#2 Updated by Dan Gillean over 8 years ago

Hi Tim,

I've been unable to reproduce this problem and am wondering if it has to do with your local configuration.

In our test environment, the URL came through fine.

Similarly, I tested on the demo site and did not have a problem - see for example: http://demo.accesstomemory.org/famous-cloak-and-suit-company-ltd;ead?sf_format=xml

As well, here is a case where the digital object was linked to an external resource (on the AC beta site):
http://archivescanada.accesstomemory.org/victoria-gray;ead?sf_format=xml

I will ask one of our developers to take a look at the issue and see if they have suggestions for how it might be resolved, if it is in fact a configuration issue on your end.

#3 Updated by Dan Gillean over 8 years ago

Upon closer examination, I see now that this was about the command line - my tests were via the user interface. Will make sure this is tested and updated accordingly. Sorry for the confusion.

#4 Updated by Dan Gillean over 8 years ago

  • Category set to Import/Export
  • Assignee set to Jesús García Crespo
  • Priority changed from Medium to High
  • Target version set to Release 1.4.0

Confirmed and reproduced. Also noted in 1.x - assigning to 1.4 for consideration. Thanks for catching this Tim.

#5 Updated by Tim Hutchinson over 8 years ago

Digging around in symfony forums etc., I see that this is apparently a known limitation of symfony tasks. In case these help:
http://stackoverflow.com/questions/3285953/using-routes-to-generate-urls-in-a-symfony-task
http://snippets.symfony-project.org/snippet/378

#6 Updated by Mike Cantelon almost 8 years ago

  • Assignee changed from Jesús García Crespo to Mike Cantelon

#7 Updated by Mike Cantelon almost 8 years ago

It seems there's no foolproof way to generate a full URL (including the hostname), from a CLI task, with AtoM. So I'm going to make the site URL a CLI argument.

#8 Updated by Mike Cantelon almost 8 years ago

  • Status changed from New to QA/Review
  • Assignee changed from Mike Cantelon to Mike Gale

I've created a pull request for specifying URL via a CLI argument: https://github.com/artefactual/atom/pull/40

#9 Updated by Mike Gale almost 8 years ago

  • Target version changed from Release 1.4.0 to Release 2.1.0

I'll discuss briefly with Dan on Monday if we should make that URL argument optional or not.

#10 Updated by Tim Hutchinson almost 8 years ago

Would it work to add it as a setting instead?

#11 Updated by Mike Cantelon almost 8 years ago

Tim Hutchinson wrote:

Would it work to add it as a setting instead?

Yeah, adding it as an optional AtoM setting could be useful for this and any other similar cases (and I don't think would require any DB schema changes).

#12 Updated by Mike Gale almost 8 years ago

I merged mcantelon's fix into qa/2.1.x, export:bulk now has an option --site-url.
So if your site is example.com/atom, you'd run php symfony export:bulk --site-url='http://example.com/atom/' myfolder

#13 Updated by Mike Gale almost 8 years ago

  • Status changed from QA/Review to Verified

#14 Updated by Mike Gale almost 8 years ago

  • Status changed from Verified to In progress

Oops, I should try reading the ticket summary more closely next time. Needs one more tweak to fix this issue..

#15 Updated by Mike Gale almost 8 years ago

  • Status changed from In progress to QA/Review
  • Assignee changed from Mike Gale to Dan Gillean

I pushed a fix to qa/2.1.x

#16 Updated by Mike Gale almost 8 years ago

Please note to get this to work you must use the new export:bulk CLI option e.g.,

php symfony export:bulk --site-url="http://www.example.com/atom/" ead_folder

If you don't use the --site-url option, AtoM will fall back to the old behavior.

#17 Updated by Dan Gillean almost 8 years ago

  • Status changed from QA/Review to Verified
  • Tested version 2.0.0, 2.0.1 added

#18 Updated by Dan Gillean over 7 years ago

Actually, this functionality has been changed!

We have simplified this. Rather than requiring users to remember the workaround and use the "--site-url" option every time, we have instead included a place in Admin > Settings > Site information where the base URL of your site can be entered - it will be used during the export task. See the attached image to know where to add the information.

#19 Updated by Tim Hutchinson over 7 years ago

Very nice - I was hoping for something in one of the config files, so this is even better :)

#20 Updated by Dan Gillean over 7 years ago

  • Status changed from Verified to QA/Review
  • Target version changed from Release 2.1.0 to Release 2.2.0
  • Requires documentation set to Yes

Actually, the new siteBaseURL will go in 2.2. For now, the --site-url: flag is still included in the CLI bulk export task. See also #7437. Mike C has added some 2.2 docs to the installation instructions, but 2.2 will also require updates to the CLI task for bulk export, and instructions added for the settings page.

#21 Updated by Dan Gillean about 7 years ago

  • Status changed from QA/Review to Verified
  • Tested version 2.2 added

#22 Updated by Dan Gillean about 7 years ago

  • Requires documentation deleted (Yes)
Base URL documentation in settings page added to 2.2 docs: --site-url option removed from Bulk export CLI task in 2.2 docs:

Also available in: Atom PDF