Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
#1668820: Concept, base class, and interface for Configurables (e.g., node types, image styles, vocabularies, views, etc)
#1649238: Implement CMI Exportable Controller
#1641820: Convert default views and current calls to ctools_export_crud_* to new exportable system
#1650778: Convert default views into YAML files for CMI
Comment | File | Size | Author |
---|---|---|---|
#40 | views-1741154-40.patch | 153.58 KB | tim.plunkett |
#40 | interdiff.txt | 20.43 KB | tim.plunkett |
#39 | interdiff.txt | 6.4 KB | xjm |
#36 | 1741154-34.patch | 133.7 KB | dawehner |
#31 | 1741154-31.patch | 130.35 KB | dawehner |
Comments
Comment #1
tim.plunkettComment #2
tim.plunkettComment #3
damiankloip CreditAttribution: damiankloip commentedThis implements the views entity type, that extends the new configuration entities. The views can at the moment just be loaded. This will definitely fail the bot atm.
Very much a work in progress.
Comment #4
dawehnerLet's see whether the tests aren't broken.
Comment #6
tim.plunkettRerolling after rebasing locally.
Comment #8
dawehnerTake that!
Comment #10
dawehnerRecent changes should fixed a lot of the php errors.
Comment #12
xjmJust a note: all these need docblocks. :)
Comment #13
dawehnerMaybe this fixes some of the tests, you never know.
Comment #15
dawehner#13: 1741154-config-13.patch queued for re-testing.
Comment #17
dawehnerReplaced the default views by default views in config, so this stuff should run now.
Comment #19
dawehnerThis patch should at least fix a lot of the exceptions.
Comment #21
dawehnerComment #23
dawehnerA lot of the remaining exceptions are connected directly with the ctools export ui system.
Here are some more fixes.
Comment #25
dawehnerComment #27
dawehnerThis has the change to fix a lot of the errors.
Comment #29
dawehnerThis should fix the notices.
Comment #31
dawehnerThis could probably fix all of them.
Comment #32
aspilicious CreditAttribution: aspilicious commentedIf we *always* need to call a view like this in code. I suggest making a custom constructor with no arguments, calling the parent with the needed arguments.
Would be a LOT cleaner :)
Comment #33
dawehnerBut this is sadly not possible as the constructor is part of the entity interface.
Comment #34
aspilicious CreditAttribution: aspilicious commentedWHYYYYY do you want a constructor in an interface. I consider that a core bug... Seriously...
Comment #35
tim.plunkettIt is possible in PHP 5.3 but not in PHP 5.4, so it's not worth changing it.
Nowhere in core does anything do
new Entity()
, for Node/User/Comment etc, everything uses entity_create().That's not worth doing in the tests, but should be done elsewhere.
Assigning to myself for full review tomorrow.
Comment #36
dawehnerIn the long run i think it probably makes sense to maybe
remove the display options.
On the viewExecutor $view->display['foo'] would contain directly the display handler.
On the storage view ->display[''] would contain just the config information which might or might not make things
easier to understand.
Made some minor docu changes and removed even more code.
Comment #37
dawehner.
Comment #38
xjmJust some mostly nitpicky docs stuff. Is all this in @damiankloip's sandbox? If so I'll apply corrections there.
So in this patch we're creating new view objects three ways: Constructing them with the namespace used, constructing them with the fully qualified classname, and using
entity_create()
. Let's add comments or a helper method for the tests or something. :)s/that/the/ and s/the the/the/
Probably "adding, saving, and loading".
"Ensure" rather than "Take sure". :)
The summary should start with "Loads", and the
@param
and@return
need descriptions.The class description should start with a verb.
Need a docblock for the constructor.
Should be "saves"/"loads" instead of "save"/"load".
it's 100% clear what this does from reading the code, but the summary is more vague here. How about "Toggles a view's status between enabled and disabled"?
These should be
@param
rather than@var
.We can say just "The view object to check."
How about "Loads a view from configuration"?
We need a blank line between the
@param
and@return
.Comment #39
xjmHere are the docs cleanups I just pushed to the branch. I think we should clean up the
ViewDisplay
constructor a bit. We should probably pass three parameters: the ID, the plugin ID/type/whatever, and then an array of additional options. That way we can fail meaningfully if required properties are missing, and provide sensible defaults for the less critical ones.That way we also don't have to pack up so many arrays everywhere to construct these. ;)
Comment #40
tim.plunkettOkay, here's the "final" patch. And my interdiff.
Comment #41
damiankloip CreditAttribution: damiankloip commentedNot sure if I can RTBC a patch I've written alot of.... but the tidy up looks great! Obviously on passing.
Comment #42
xjmLots of great code cleanup in there. Thanks @tim.plunkett!
Some more details here might be nice.
81 chars. :P
This is a little awkward. How about simply:
"The key to the display in $view->display, or FALSE if no plugin ID was provided.
Let's anglify these comments a little. Also, "human-readable" should be hyphenated.
Did we change
$type
to$plugin_id
elsewhere? In either case, let's add an example. (E.g. 'page', right?)Since we asked about this in person, let's add examples wherever this parameter appears? (
page_1
,page_2
, etc., right?)Edit: and/or an @see to the method where it's already more thoroughly documented elsewhere in the class.
Whoa. Note to myself to ask about this.
Let's clarify more what "items" are in the documentation for all these methods. Gets the configuration of an abstract noun!
item == item with a handler == anything that has a handler?
I like the code cleanup here, but I don't understand the second half of the comment.
Otherwise (and the comma) are not grammatical here. Let's say something like:
A specific display machine name to use. If NULL, the current display will be used.
Do the setters want to return something? (The answer might be no. I need to check the full patch.)
set_item()
should have parens. Also let's add an @see to the other method at the bottom of the docblock, and from the other method's docblock to this method.Comment #43
xjmWhoops, xposted.
Note that I haven't reviewed the final diff between the sandbox and 8.x-3.x yet; I just reviewed Tim's interdiff.
Comment #44
tim.plunkettCleaned up the stuff from #42, and merged in!
Follow up is #1760284: Rewrite ViewListController to use the core EntityListController.
Awesome stuff!
Comment #45
tim.plunkettThe plugin stuff is in #1779728: Either replace hook_views_data(), or find a non-CTools way to load *.views.inc files