#1 √ resolved
theory

publish_status => 0 Does not work

Reported by theory | April 28th, 2009 @ 06:22 PM | in 1.11.2

I was writing a template today with code like this:

for my $t (ref($story)->list({
    element_key_name  => 'topic',
    site_id           => $story->get_site_id,
    unexpired         => 1,
    published_version => $burner->get_mode == PUBLISH_MODE,
})) {
    # ...
}

To my chagrin, it didn't work. It thinks it's only supposed to show published_versions for some reason, even in preview mode. This is irritating. I had to change it to:

( $burner->get_mode == PUBLISH_MODE ? (published_version => 1) : ()),

Which is just stupid. It should work properly with published_version => 0 or published_version => ''. So fix it!

Comments and changes to this ticket

  • theory

    theory April 28th, 2009 @ 06:22 PM

    • → Assigned user changed from “Bugs (at bricolage)” to “theory”
    • → State changed from “new” to “open”
    • → Milestone set to 1.11.2
  • theory

    theory April 28th, 2009 @ 06:24 PM

    Scott added in a comment:

    I'd guess that checked_in (and probably anything in PARAM_WHERE_MAP that doesn't have a '?' in it) would also work like that, though its documentation says otherwise.

    published_version => "s.published_version = i.version AND i.checked_out = '0'",
    
    checked_in             => 'i.checked_out = '
                            . '( SELECT checked_out '
                            . 'FROM story_instance '
                            . 'WHERE version = i.version '
                            . 'AND story__id = i.story__id '
                            . 'ORDER BY checked_out ASC LIMIT 1 )',
    
    
  • phillipadsmith

    phillipadsmith May 12th, 2009 @ 02:34 AM

    • → Tag changed from api, burn, list, publish, publish_status, story, template, templating to api, burn, list, publish, publish_status, slanning, story, template, templating

    [tagged:"slanning" bulk edit command]

  • theory

    theory November 3rd, 2009 @ 01:44 AM

    Replicated in a regression test, will try to fix now. For ticket # 77 I inadvertently tested publish_status instead of published_version. D'oh!

  • theory

    theory November 3rd, 2009 @ 02:01 AM

    Fixed. checked_out doesn't have this behavior because it was already worked-around some time ago.

  • theory

    theory November 3rd, 2009 @ 02:02 AM

    • → State changed from “open” to “resolved”

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket

Referenced by