On Wed, 11 Mar 2009, theory@bricolage.cc wrote:
> Revision: 8490
[...]
> --- bricolage/branches/rev_1_10/contrib/bric_media_upload/bric_media_upload 2009-03-11 18:55:37 UTC (rev 8489)
> +++ bricolage/branches/rev_1_10/contrib/bric_media_upload/bric_media_upload 2009-03-11 23:42:04 UTC (rev 8490)
> @@ -398,6 +398,7 @@
> <description></description>
> <uri>$media_uri</uri>
> <priority>3</priority>
> + <publish_status>0</publish_status>
This doesn't actually fix it, though,
because the media is possibly being updated
and has therefore possibly been published already.
My local fix (I thought I committed it before,
but I guess not) isn't really better but assumes
that on update that it's already been published:
# xxx: here I just declare that if we're updating
# then it's already been published before;
# I don't know how else to do it with our crappy soap interface
my $publish_crap = $operation eq 'create'
? ' <publish_status>0</publish_status>'
: <<EOPC;
<publish_status>1</publish_status>
<first_publish_date>$media_cover_date</first_publish_date>
<publish_date>$media_cover_date</publish_date>
EOPC
my $infoelements = ($media_info) ? get_media_info($media_file) : '';
# put vars into xml skeleton
my $media_xml = <<"EOS";
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assets xmlns="http://bricolage.sourceforge.net/assets.xsd">
<media id="$media_id" element="$media_type">
<site>$site</site>
<name>$media_name</name>
<description></description>
<uri>$media_uri</uri>
<priority>3</priority>
<active>1</active>
<source>$content_source</source>
<cover_date>$media_cover_date</cover_date>
$publish_crap
....
It'd probably be better for Bric::SOAP to ignore <publish_status>
(and first_publish_date and publish_date) on create/update.
> Revision: 8490
[...]
> --- bricolage/branches/rev_1_10/contrib/bric_media_upload/bric_media_upload 2009-03-11 18:55:37 UTC (rev 8489)
> +++ bricolage/branches/rev_1_10/contrib/bric_media_upload/bric_media_upload 2009-03-11 23:42:04 UTC (rev 8490)
> @@ -398,6 +398,7 @@
> <description></description>
> <uri>$media_uri</uri>
> <priority>3</priority>
> + <publish_status>0</publish_status>
This doesn't actually fix it, though,
because the media is possibly being updated
and has therefore possibly been published already.
My local fix (I thought I committed it before,
but I guess not) isn't really better but assumes
that on update that it's already been published:
# xxx: here I just declare that if we're updating
# then it's already been published before;
# I don't know how else to do it with our crappy soap interface
my $publish_crap = $operation eq 'create'
? ' <publish_status>0</publish_status>'
: <<EOPC;
<publish_status>1</publish_status>
<first_publish_date>$media_cover_date</first_publish_date>
<publish_date>$media_cover_date</publish_date>
EOPC
my $infoelements = ($media_info) ? get_media_info($media_file) : '';
# put vars into xml skeleton
my $media_xml = <<"EOS";
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assets xmlns="http://bricolage.sourceforge.net/assets.xsd">
<media id="$media_id" element="$media_type">
<site>$site</site>
<name>$media_name</name>
<description></description>
<uri>$media_uri</uri>
<priority>3</priority>
<active>1</active>
<source>$content_source</source>
<cover_date>$media_cover_date</cover_date>
$publish_crap
....
It'd probably be better for Bric::SOAP to ignore <publish_status>
(and first_publish_date and publish_date) on create/update.