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
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