Closed (fixed)
Project:
Drupal core
Version:
8.2.x-dev
Component:
rest.module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
2 Oct 2015 at 16:57 UTC
Updated:
24 May 2016 at 16:14 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
kylebrowning commentedComment #3
kylebrowning commentedComment #6
eclipsegc commentedwtf?
Comment #7
kylebrowning commentedI know right @EclipseGC
Comment #10
willzyx commentedComment #11
kylebrowning commentedI didn't see those two places @willzyx, thanks.
Comment #12
kylebrowning commentedI guess lets keep the use of id consistent?
Comment #13
kylebrowning commentedInterdiff wasn't added for some reason, sorry.
Comment #14
eclipsegc commentedThis looks like a really big win, is ridiculously simple and also a better usage of Plugins in general.
Eclipse
Comment #15
alexpottThis looks like a task tbh and not a bug. Also can't see why this is a big win - yes less code is nice but there is no bug in the current code it is just clunkier. Afaics this doesn't meet https://www.drupal.org/core/beta-changes. Postponing to a patch release
Comment #16
kylebrowning commentedYeah i suppose it is no 8.0.x but 8.1.x which is fine.
Cleaner saner code IMO should always be used.
Comment #17
wim leersDuplicate of #2625554: getInstance() fatals on almost all plugin managers.
Comment #18
eclipsegc commentedHow is this a duplicate? That issue specifies that getInstance() fatals on most plugin managers... this plugin manager actually implements getInstance() needlessly. Two very different things, no?
Eclipse
Comment #19
chi commentedI would agree. This is just a minor cleanup not related to #2625554: getInstance() fatals on almost all plugin managers.
Comment #20
kylebrowning commentedComment #22
kylebrowning commentedRe-roll.
Comment #26
willzyx commentedComment #27
kylebrowning commentedComment #28
alexpottImo we should be marking this as deprecated for Drupal 9... since removing this now is unnecessary and will break code that currently works.
Comment #29
alexpottAll the other changes are fine but the change outlined in #28 is not patch or minor release safe.
Comment #30
willzyx commentedRestored ::getInstance() method and marked it as deprecated. Back to RTBC
Comment #31
kylebrowning commentedGreat call on #28.
This looks done.
Comment #32
catchI'm not sure what it means to deprecate an interface method. This is from MapperInterface which is implemented by DefaultPluginManager
If we remove the override in 9.x but don't do anything else, then it'll still have the method, just inherited from DefaultPluginManager - will that not work then?
Comment #33
willzyx commentedWe simply want to encourage developers to use the proper method to create an instance of resource plugins instead of relying on the unnecessary implementation of ResourcePluginManager::::getInstance().
it wont work, exactly like other plugin managers that not implement ::getInstance() see #2625554: getInstance() fatals on almost all plugin managers (but as said in #18 by Eclipse Gc the two issues are not a duplicate)
Comment #34
wim leersIOW:
ResourcePluginManagermistakenly abuses\Drupal\Component\Plugin\Mapper\MapperInterface::getInstance()for the purpose that\Drupal\Component\Plugin\Factory\FactoryInterface::createInstance()exists for.Also see #1894130: Make \Drupal\Core\Plugin\Mapper\MapperInterface optional for plugin managers, which explains:
Comment #35
alexpottI think this needs to be more nuanced. As @catch points out this method might still exist in Drupal 9. What we're really doing here is deprecating its usage for creating new instances.
Comment #36
kylebrowning commented@alexpott, can you be more specific on what I should do here?
Comment #37
dawehnerWhat about simply using:
* @deprecated in Drupal 8.2.0
+ * Use Drupal\rest\Plugin\Type\ResourcePluginManager::createInstance()
+ * instead.
Comment #38
kylebrowning commentedComment #40
kylebrowning commentedRe-roll, the only changes are the suggestions in #37
Comment #41
kylebrowning commentedComment #42
kylebrowning commentedCrap, forgot to save a file.
Comment #43
kylebrowning commentedComment #44
kylebrowning commentedPutting back to RTBC since it passed.
Comment #46
catchCommitted/pushed to 8.2.x, thanks!
Comment #47
wim leersYAY, finally closing this one :)