1.9 - fix eportfolios

String#map and String#[] are no longer defined in 1.9.

Change-Id: I9deedd7ad12b7dbd93f73447e43f7809bb891c1d
Reviewed-on: https://gerrit.instructure.com/10798
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
add ruby 1.9 compat fixes

thanks to UserVoice for their blog post outlining these necessary fixes

 * fixes association proxies, causing the submission comment spec to pass
 * fixes encoding issues with params in action controller -- fixes a lot of failing api specs
 * fixes compat issues with TZInfo

Change-Id: Iaa6626a2107a437013c2a783c5929610f076b352
Reviewed-on: https://gerrit.instructure.com/10795
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
fix class variable warnings in 1.9.3

Change-Id: If72525d059f3628ad0071f1c8ceffad91c14af67
Reviewed-on: https://gerrit.instructure.com/10855
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
filter merge opportunities a bit

if we're at account A, just assume the user will log in at account A
if he can. only show the full list of accounts the user can log in at
if none of them are the current one

test plan:
 * create and merge a user in accounts A and B using non-email logins
 * enable open registration on accounts A and C
 * invite the user via e-mail to a course in accounts A and C
 * LOG OUT
 * when accepting the invitation for course in account A, it should
   not prompt for which account to login at (it should just send you
   to A)
 * when accepting the invitation for the course in account C, it
   should list both A and B as places for you to login at, and let
   you choose

Change-Id: I78e0afd1b5c9a66e35c37c8e37ed3265c4be3a59
Reviewed-on: https://gerrit.instructure.com/9357
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jeremy Stanley <jeremy@instructure.com>
don't try to migrate event attachment to section context

fixes #8572

test plan:
 - enable calendar2
 - create a course with multiple sections
 - create an event with different times per-section
 - add an attachment to the event
 - try to modify and save the event
 - make sure changes are saved, and no error is returned

Change-Id: I2d27960d5f7d570182a914b57f211da97dce0740
Reviewed-on: https://gerrit.instructure.com/10852
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
1.9 - fix some security specs

In 1.9, String no longer mixes in Enumerable, so String#grep doesn't exist.
Now we explicitly call #lines and then grep that, since that's what we were
implicitly doing before.

Change-Id: I04b3f3bc9b4090e8f37bdf1374aad8e3919c5169
Reviewed-on: https://gerrit.instructure.com/10858
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Zach Wily <zach@instructure.com>
fix undefined method call on form submit; fixes #8579

test plan:
 - start with a course with TurnItIn enabled
 - create a new assignment (don't save it yet)
 - click "more options"
 - select online submission
 - check to enable TurnItIn
 - click the "advanced" button
 - change some stuff
 - submit the form, verify it doesn't get stuck

Change-Id: I7e2a69d6038746aa39bda8d529533af5b5d9a962
Reviewed-on: https://gerrit.instructure.com/10820
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
stop requiring scribd for thumbnail urls.

this line was requiring scribd to be enabled for thumbnails to
properly generate urls - meaning avatars wouldn't work without
scribd turned on.

Change-Id: I086e3caa98507e19af36700f0adc0c3f4546f6ff
Reviewed-on: https://gerrit.instructure.com/10833
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
1.9 spec fixes

spec updates for 1.9

 * fix a syntax error
 * update our html_escape backport so that rails 1.9 doesn't print
   constant warnings about using the "n" regex option with a utf-8
   string (as a bonus this is also a lot more efficient)
 * fix using a migration class as a rspec describe context, because its
   method_missing prints the method name to console so we get a ton of
   "to_ary" etc printed
 * fix post header checks in spec/lib

Change-Id: I634570e516252e9a2fbef9f13a55d1bae0a254cd
Reviewed-on: https://gerrit.instructure.com/10856
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
1.9 - fix discussion topic pagination

In 1.8, Enumerable methods that return a new object seem to dup the receiver
and then call the modify-in-place method on that dupe. That meant that you
could chain calls to a WillPaginate::Collection object.

In 1.9, the object is no longer duplicated first, so we need to edit something
like WillPaginate::Collection in place, or it will lose it's special
pagination attributes.

Change-Id: I3bd043984d49145df9d1ea4e4931f698de3e1336
Reviewed-on: https://gerrit.instructure.com/10860
Tested-by: Zach Wily <zach@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
fix intermittently failing selenium profile pic

Change-Id: Iaa949c77d358611ef084ee1ef9e6ca8d4b18c8ef
Reviewed-on: https://gerrit.instructure.com/10862
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jake Sorce <jake@instructure.com>
rename id for list of content exports to prevent javascript error

The underscore require file has a workaround for old IE
that references an 'exports' variable. In chrome this
variable would resolve to the node on the page with the
id 'exports' and cause javascript errors.

Test Plan:
 * Load the course's content exports page in chrome
 * There should be no javascript errors in you web inspector
 * Starting an export should make the progress bar appear

refs #8655

Change-Id: I8f2196490bcfe94f0f7b2f1a6f5d5c42d279d602
Reviewed-on: https://gerrit.instructure.com/10850
Reviewed-by: Ryan Shaw <ryan@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
rename method to avoid unintended breakage

if a plugin or other code called get_context in a before_filter, it would
essentially break the calendar events API since this method was named the
same as the one in ApplicationController

test plan:
1. ensure that the calendar events API still works

Change-Id: Icd488284ea196a6f63d2f4d415dead0552f7633d
Reviewed-on: https://gerrit.instructure.com/10866
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
drop really old unused columns, round 3

Change-Id: I1ef828c0547167e1792aa9edba65b09673504f57
Reviewed-on: https://gerrit.instructure.com/10864
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
1.9 - add utf8 encoding to source file with mb chars in qti_exporter

Change-Id: Ief0de41bef8a379b4beb019a8953aee733291235
Reviewed-on: https://gerrit.instructure.com/10874
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
make the locked_* dj columns match what is in the db

Because of how we query the function in a subselect, the returned data
doesn't include the changes to these two columns that happen in the
UPDATE in the function. so we update the columns client-side to match
what's in the database.

test plan: schedule a delayed job and then delete the record it points
to before it runs. then allow the job to run, and verify that it gets
properly unlocked after it fails.

Change-Id: I08807c88adb2a3ae4f901535f8d0e220962b887a
Reviewed-on: https://gerrit.instructure.com/10895
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Wily <zach@instructure.com>
link_data endpoint for canvas collections

Canvas will use this to pull the data about a link before creating a
collection item (currently uses embed.ly)

test plan: not possible to test this through the UI yet

Change-Id: Ie248be4081871aa3aa747510d96edc3c7cc3a0a6
Reviewed-on: https://gerrit.instructure.com/10777
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Ryan Shaw <ryan@instructure.com>
update encrypted_cookie_store to 1.0.1

test plan:
 * wait for your session to expire, and refresh the page
 * it shouldn't page error

Change-Id: Ic2c8f3f26dfd14dc5cf98d180ba9b233c37d04d9
Reviewed-on: https://gerrit.instructure.com/10901
Reviewed-by: Brian Palmer <brianp@instructure.com>
Tested-by: Brian Palmer <brianp@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
handle sorting quiz questions with nil position; fixes #8639

when retrieving all the quiz questions for a quiz edit page in the correct
order, we need to be robust to the possibility of the quiz questions position
attribute being nil.

test plan:
- in a quiz in a state where you have a quiz question with a nil position
  inside of a question group
- make sure the edit quiz page loads

Change-Id: I79abb4bdb397cfb1b329a7ae95b7046f03d667f0
Reviewed-on: https://gerrit.instructure.com/10907
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Brian Palmer <brianp@instructure.com>
added `description` to assignment creation api

Change-Id: I3986ecf0e3b2c2d57dd20150862e7ceec5090b1b
Reviewed-on: https://gerrit.instructure.com/10913
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>