Mailing List Archive

Publish Status Via SOAP
Fellow Bricoleurs,

I've just dealt with another report of issues importing stories into Bricolage via SOAP and getting failures because the imported story had its publish status set to true. It happens because of this code:

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);
}

Essentially, if you're creating a new document, it always sets publish_status to false. I'm starting to think that maybe this is just a stupid idea. If someone wants to create a story and mark it as published even if it has never been published by the Bricolage instance it's being created in, why shouldn't they?

So would anyone complain if I removed this "intelligence" in favor of just

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} || 0);
}

Comments?

Best,

David
Re: Publish Status Via SOAP [ In reply to ]
On 29-Mar-10, at 5:14 PM, David E. Wheeler wrote:

> Fellow Bricoleurs,
>
> I've just dealt with another report of issues importing stories into
> Bricolage via SOAP and getting failures because the imported story
> had its publish status set to true. It happens because of this code:
>
> 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);
> }
>
> Essentially, if you're creating a new document, it always sets
> publish_status to false. I'm starting to think that maybe this is
> just a stupid idea. If someone wants to create a story and mark it
> as published even if it has never been published by the Bricolage
> instance it's being created in, why shouldn't they?
>
> So would anyone complain if I removed this "intelligence" in favor
> of just
>
> 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} ||
> 0);
> }
>
> Comments?

+1 if it makes it possible to:

bric_soap story export --all 1183 | bric_soap story create -


:-)

Phillip.

--
Phillip Smith // Simplifier of Technology // COMMUNITY BANDWIDTH
www.communitybandwidth.ca // www.phillipadsmith.com
Re: Publish Status Via SOAP [ In reply to ]
I'm all for the change.

If you're keeping your site but just migrating from one Bricolage to
another, preserving the publish status from the previous install totally
makes sense.

Or at least it means one fewer script to write to process the XML before
you SOAP it in to the new install.

Cheers,

Bret


On Mon, 2010-03-29 at 17:29 -0400, Phillip Smith wrote:
> On 29-Mar-10, at 5:14 PM, David E. Wheeler wrote:
>
> > Fellow Bricoleurs,
> >
> > I've just dealt with another report of issues importing stories into
> > Bricolage via SOAP and getting failures because the imported story
> > had its publish status set to true. It happens because of this code:
> >
> > 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);
> > }
> >
> > Essentially, if you're creating a new document, it always sets
> > publish_status to false. I'm starting to think that maybe this is
> > just a stupid idea. If someone wants to create a story and mark it
> > as published even if it has never been published by the Bricolage
> > instance it's being created in, why shouldn't they?
> >
> > So would anyone complain if I removed this "intelligence" in favor
> > of just
> >
> > 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} ||
> > 0);
> > }
> >
> > Comments?
>
> +1 if it makes it possible to:
>
> bric_soap story export --all 1183 | bric_soap story create -
>
>
> :-)
>
> Phillip.
>
> --
> Phillip Smith // Simplifier of Technology // COMMUNITY BANDWIDTH
> www.communitybandwidth.ca // www.phillipadsmith.com
>
>
>
>
>
>
>
>


--
Bret Dawson
Producer
Pectopah Productions Inc.
(416) 895-7635
bret@pectopah.com
www.pectopah.com
Re: Publish Status Via SOAP [ In reply to ]
On Mar 29, 2010, at 8:04 PM, Bret Dawson wrote:

> I'm all for the change.
>
> If you're keeping your site but just migrating from one Bricolage to
> another, preserving the publish status from the previous install totally
> makes sense.
>
> Or at least it means one fewer script to write to process the XML before
> you SOAP it in to the new install.

Yeah, that's the idea.

[Done](http://github.com/bricoleurs/bricolage/commit/425f09b337fd63ccf2afb9c0448812bc8b7f644a).

Best,

David