To reproduce:
Create two schedules, give one at least one program, leave the other blank.
Create a view, built on nodes.
Filter by node type = Schedule, Station schedule = Has scheduled programs
Add node title as a field

Expected result:
Title of the schedule with programs

Actual result:
Nothing

Supposed cause:
station_schedule_handler_filter_schedule_item.inc is whack
It is used for both "Station schedule=Has scheduled programs" and "Station Program=Is scheduled"
hardcorded for station programs

Solution:
create another handler?
fix this one?

The reason I came across this was because it had the whole (empty($this->value) ? '=' : '<>') . " 0" that I reused in #757408: Add views filter for "Is default schedule".

Also, I'm really really confused about the views base_table and real_field and building views on station_schedule_item vs building on nodes and using relationships and I'm not sure how to fix any of this.

Comments

tim.plunkett’s picture

Assigned: Unassigned » tim.plunkett

This is my other priority for a stable release.

tim.plunkett’s picture

Status: Active » Needs review
StatusFileSize
new2.27 KB

First thing was removing the redundant empty().
The other was switching the "real field" for the calls to station_schedule_handler_filter_schedule_item. Instead of (wrongly) hardcoding ssi.program_nid, I think it would make more sense to hardcode $this->table_alias.nid, that way the handler can be used for both "Is Scheduled" and "Has scheduled programs".

In addition to the "steps to reproduce" in the OP, to test the other situation:

  • Create two programs and one schedule, add one of the programs to the schedule.
  • Create a view, built on nodes.
  • Filter by node type = Program, Station schedule = Is scheduled
  • Add node title as a field

Expected result: Title of the program on the schedule

drewish’s picture

ah yeah that seems like a good approach. haven't had a chance to test it though. if you're comfortable with it commit away.

tim.plunkett’s picture

Status: Needs review » Fixed

Well I botched my commit message, but it's been committed to HEAD.
I'll tag a beta release later tonight, I think.

tim.plunkett’s picture

I really did not have a smooth commit experience today. I accidentally also committed several small coding style fixes, sorry. Won't happen again!

tim.plunkett’s picture

StatusFileSize
new3.77 KB

For reference purposes, this was the coding style patch I somehow managed to accidentally commit.

drewish’s picture

They all look good to me.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.