Skip to content
This repository

Incorrect NSManagedObjectContext used in MR_requestAllSortedBy #294

Closed
JubblerJr opened this Issue · 0 comments

2 participants

JubblerJr Stephen Vanterpool
JubblerJr

Came across a slight issue in the following method

+ (NSFetchRequest *) MR_requestAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context

Rather than execute against the passed in NSManagedObjectContext it is using [NSManagedObjectContext MR_contextForCurrentThread]

So it should read

    return [self MR_requestAllSortedBy:sortTerm
                         ascending:ascending
                     withPredicate:nil 
                         inContext:context];

rather than

    return [self MR_requestAllSortedBy:sortTerm
                         ascending:ascending
                     withPredicate:nil 
                         inContext:[NSManagedObjectContext MR_contextForCurrentThread]];
Marcin Zbijowski zbiju referenced this issue from a commit in zbiju/MagicalRecord
Marcin Zbijowski Merge remote-tracking branch 'upstream/master'
* upstream/master:
  Bumping podspec version
  Fixed Issue #294 - MR_requestAllSortedBy:ascending:inContext: did not use correct context
  Added fetchAllWithDelegate: method for NSFRC
  Separate printing context chain method into its own method change contextWorkingName to property workingName
  removed MR_saveErrorHandler, as it and MR_saveWithErrorCallback were essentially duplicates MR_save now only saves the current context (it was essentially doing a MR_saveNestedContexts). If you need to save all the way out to disk, use MR_saveNestedContexts. Removed the action queue, unneccesary since core data introduced it's own queue support
  don't check the error, rely only on the return value of methods to determine success
  Cleanup contextWillSave method Update deleting incompatible store
  Adding changelog
  Fixed issue #287 - MR_findByAttribute:withValue:andOrderBy:ascending:inContext does not pass context through
  Bumped podspec to 2.0.7
  Test that the current thread saveWith method actually saves
  saveWithBlock was not saving parent contexts
  Rolled back a commit that broke things if cleanup was used. It created the action_queue in a dispatch_once block, and never recreated it after a cleanup
  Cherry picking changes that make the context description more... descriptive
  Fixing potential concurrency issue with creating the actionQueue
  Properly removing existing on-save notificaitons before replacing the default or root contexts
  Bump tag to 2.0.6
  Require ARC in podspec (was compiling with retain/release in pod installations)
  Fixed KVC relationship mapping bug.
659f41f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.