Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publishing Simplified #1212

Merged
merged 15 commits into from
Jan 12, 2016
Merged

Publishing Simplified #1212

merged 15 commits into from
Jan 12, 2016

Conversation

jrjohnson
Copy link
Member

Instead of publish events we no use a published boolean on courses, session, programs, and program years.

Publishing was completely removed from offerings.

Fixes #1041

Complementary frontend ticket ilios/frontend#1294

@jrjohnson
Copy link
Member Author

@stopfstedt I need some help with this. For some reason the test user has lost permission to POST a cohort. But I can't figure out what I changed to make that happen.

@jrjohnson
Copy link
Member Author

@saschaben this is our first 'big change'. I'm not sure how we want to handle discussion and approval.

@homu
Copy link
Contributor

homu commented Dec 21, 2015

☔ The latest upstream changes (presumably #1213) made this pull request unmergeable. Please resolve the merge conflicts.

@jrjohnson
Copy link
Member Author

This should not be merged until after the 3.1 release.

@saschaben
Copy link
Member

just reviewing; in the migration, are we planning on leaving the existing but deprecated (and orphaned) offering.publish_event_id values, or are we cleaning that up? I don't see the ALTER or DROP TABLE values to make the modification to offering......

@jrjohnson
Copy link
Member Author

I believe we discussed and decided to just drop it. It's dropped in the migration on line 40.

@saschaben
Copy link
Member

cool thnks!

$publishEvent = $offering->getSession()->getPublishEvent();
return isset($publishEvent);
$session = $offering->getSession();
return ($session && $session->isPublished());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter out offering if owning course isn't published. see #1244.

@stopfstedt
Copy link
Member

LGTM otherwise.

@stopfstedt
Copy link
Member

click-tested publishing workflow thru the frontend, holds up for me.

@homu
Copy link
Contributor

homu commented Jan 7, 2016

☔ The latest upstream changes (presumably #1245) made this pull request unmergeable. Please resolve the merge conflicts.

This sets the published boolean for anything that used to have a
publish event and removes the published event concept completely.
Use published boolean instead
If we lock this then we cannot create a new cohort in the cohort test.
Permission is denied.
's.title, st.sessionTypeCssClass, ' .
's.publishedAsTbd as sessionPublishedAsTbd, s.published as sessionPublished, ' .
'c.publishedAsTbd as coursePublishedAsTbd, c.published as coursePublished';
$qb->add('select', $what)->from('IliosCoreBundle:School', 'school');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double trouble! please remove.

Rebase introduced a double line of the same code, this fixed that.
@@ -458,17 +459,16 @@ protected function getIlmSessionEventsFor($id, \DateTime $from, \DateTime $to, a
{
$qb = $this->_em->createQueryBuilder();
$what = 'ilm.id, ilm.dueDate, ' .
's.updatedAt, s.title, s.publishedAsTbd as sessionPublishedAsTbd, st.sessionTypeCssClass,' .
'pe.id as publishEventId, cpe.id as coursePublishEventId, c.publishedAsTbd as coursePublishedAsTbd';
's.title, st.sessionTypeCssClass, ' .
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add s.updatedAt, to string here.

This got removed during the rebase, shouldn't have been
This is now comming out of the API correctly.  Yay!
@@ -70,7 +68,7 @@ protected function getData()
'cohorts' => ['1'],
'reminders' => ['1', '2'],
'pendingUserUpdates' => [],
'permissions' => ['2', '3', '1']
'permissions' => ['1', '2', '3']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be 'permissions' => ['2', '3', '1']

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails on my machine. I wonder why it is different..... :(

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, linux and OSX process this differently. No idea why. Maybe just to annoy me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up explicitly sorting user permissions. Seems to work.

For whatever reason this is unreliably sorted which makes tests fail.
This sorts suer permissions by the permission ID constantly.
@jrjohnson
Copy link
Member Author

@stopfstedt ready for review!

stopfstedt added a commit that referenced this pull request Jan 12, 2016
@stopfstedt stopfstedt merged commit 0adb21f into ilios:master Jan 12, 2016
@jrjohnson jrjohnson deleted the 1041-publishing branch January 12, 2016 17:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants