Closed (fixed)
Project:
Page Manager
Version:
8.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Dec 2015 at 16:19 UTC
Updated:
23 Jan 2017 at 14:09 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
dsnopekHere's the first pass at this! This needs some work - basically, just cleaning things up and properly injecting the right entity manager to load page variants (rather than using the static method).
Comment #3
dsnopekAlright! I did the clean-up I wanted to do and tried to do the appropriate thing for all the error conditions. This depends on #2636478: IPE shouldn't depend on Page Manager getting committed first, but I think it's at least ready for initial reviews!
Comment #4
dsnopekHere's a version that makes the Panels storage service private, and specifies an explicit name rather than using the service id.
Comment #5
tim.plunkettPlease switch from ! to .
Can you put back that newline? :)
I really wanted to say "this should use instanceof" and "this should use the ::class constant" but both of those would break due to loading a possibly-non-existent class. Let's put a comment here explaining that, so no one accidentally "fixes" it later.
Can't we just document this here?
Missing newline
Comment #6
dsnopek@tim.plunkett: Thanks!
I addressed all points except for #5.4, which I don't entirely understand..
It sounds like you're saying that we should type hint on the
loadPageVariant()'s return value, however, that type hint is for the value returned byPageVariantInterface::getVariantPlugin()which normally returnsVariantInterface, however, we know that it's going to be aPanelsDisplayVariantbecause we do theinstanceofcheck in a couple lines.Comment #7
dsnopekChatted with @tim.plunkett on IRC and got to the bottom of what he meant! Removed the unnecessary @var statement.
Comment #8
dsnopekHere's some tests for this! They should fail because they need Panels. Hopefully, #2647014: Add Panels to test_dependencies so we can test PanelStorage will be able to fix this.
Comment #10
tim.plunkettI wish I'd been able to review \Drupal\panels\Storage\PanelsStorageInterface before it went in, we should never use the bare \Exception class anywhere :(
Reworked the tests to use Prophecy.
Comment #11
tim.plunkettAs per http://php.net/manual/en/internals2.opcodes.instanceof.php#108164 and my own testing https://3v4l.org/1YoDo, I'm nixing the is_a call.
Comment #12
dsnopekHere's how this patch would look if we made PanelStorage into plugins per #2648620: PanelsStorage should be plugins :-/. This feels like it might be worse DX for the implementor of the different PanelsStorage's. :-/
Comment #13
dsnopekHere's a for real patch which is based on #2648620: PanelsStorage should be plugins :-/ from Panels. The interdiff is from #11 to this patch (we'll just pretend my half patch on #12 didn't happen ;-)).
This will probably fail tests because it depends on the Panels changes in #2648620. But the tests are passing for me locally!
Comment #16
tim.plunkettCommitted
Comment #19
damienmckenna