diff --git a/lib/Bric/Changes.pod b/lib/Bric/Changes.pod index 90ec78fae..b05b946fd 100644 --- a/lib/Bric/Changes.pod +++ b/lib/Bric/Changes.pod @@ -103,6 +103,16 @@ contributor type proile, the cursor displays as a "move" cursor, to indicate that one can drag the field names in order to change their order. This corresponds to the interface for reordering fields in documents. [David] +=item * + +When creating new stories or media via the SOAP interface, Bricolage no longer +forces the publish status to be set to false, but sets it to true if the the +publish date is set or the publish status is true in the XML. In such cases, +it will also set the published version number to version 1. This is to make it +easier for one to migrate documents from one Bricolage instance to another +without having to edit the XML to set the publish status to a true value. +[David] + =back =head2 Bug Fixes @@ -239,6 +249,12 @@ When relating a story or media document, clicking a column header in the search results in the related search popup no longer throws an error. Thanks to Phillip for the report (Bug #149). [David] +=item * + +The SOAP interface now sets the published version to the new version of a +story or media document that is being updated by XML that says the document is +published and where the published version was not previously set. [David] + =back =head1 Version 1.11.3 (2010-01-28) diff --git a/lib/Bric/SOAP/Media.pm b/lib/Bric/SOAP/Media.pm index d998c67b8..f71cc9e45 100644 --- a/lib/Bric/SOAP/Media.pm +++ b/lib/Bric/SOAP/Media.pm @@ -809,16 +809,13 @@ sub load_asset { $media->_set(\@simple_fields, [ @{$mdata}{@simple_fields} ]); # almost totally ignoring whatever publish_status is set to - if ($update) { - if ($media->get_publish_date or $media->get_first_publish_date) { - # some publish date is set, so it must've been published - $media->set_publish_status(1); - } else { - $media->set_publish_status($mdata->{publish_status}); - } - } else { - # creating, so can't have published it yet - $media->set_publish_status(0); + $media->set_publish_status( + $media->get_publish_date ? 1 : $mdata->{publish_status} || 0 + ); + + # Set published version if it's not set. + if ($media->get_publish_status && !$media->get_published_version) { + $media->set_published_version($media->get_current_version + 1); } # remove all contributors if updating diff --git a/lib/Bric/SOAP/Story.pm b/lib/Bric/SOAP/Story.pm index c346b7849..b666d02a4 100644 --- a/lib/Bric/SOAP/Story.pm +++ b/lib/Bric/SOAP/Story.pm @@ -928,16 +928,13 @@ sub load_asset { } # almost totally ignoring whatever publish_status is set to - if ($update) { - if ($story->get_publish_date or $story->get_first_publish_date) { - # some publish date is set, so it must've been published - $story->set_publish_status(1); - } else { - $story->set_publish_status($sdata->{publish_status}); - } - } else { - # creating, so can't have published it yet - $story->set_publish_status(0); + $story->set_publish_status( + $story->get_publish_date ? 1 : $sdata->{publish_status} || 0 + ); + + # Set published version if it's not set. + if ($story->get_publish_status && !$story->get_published_version) { + $story->set_published_version($story->get_current_version + 1); } # remove all categories if updating