Closed (fixed)
Project:
Wysiwyg
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
20 Jan 2011 at 21:42 UTC
Updated:
6 Feb 2011 at 02:40 UTC
Jump to comment: Most recent file
To quote sun in #624018: Exportables and Features support for WYSIWYG 7.x:
Technically, wysiwyg_profile should be registered via hook_entity_info() anyway
The attached patch uses core's entity system for Wysiwyg profiles.
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | wysiwyg-HEAD.profile-entity.7.patch | 5.82 KB | sun |
| #6 | wysiwyg-profile-entities-1034476-6.patch | 5.17 KB | quartsize |
| #4 | wysiwyg-profile-entities-1034476-4.patch | 5.24 KB | quartsize |
| #2 | wysiwyg-profile-entities-1034476-2.patch | 4.39 KB | quartsize |
| wysiwyg.profile-entities.patch | 4.34 KB | quartsize |
Comments
Comment #1
sunThank you! Mostly looks good, only a few remarks:
Wrong indentation for the chained methods; see http://drupal.org/node/310075 or any core module for correct coding style examples.
We need to reset both the db cache and the static cache, so both lines are required in all instances.
We cannot remove the database caching, since Drupal core's entity system does not abstract that part.
However, let's move the database caching into _load_all() and call _load_all() from _load().
Missing second parameter, needs to be
FALSEto load all records.Documentation standards for hooks have changed; it's
Implements hook_...().now.Let's rename the variable to $types.
Let's add
here, so the removal of statics elsewhere in this patch is actually valid. ;)
1) Missing phpDoc; should be "Overrides ..."; see http://drupal.org/node/1354 for details.
2) Let's rename the variable to $queried_entities.
Powered by Dreditor.
Comment #2
quartsize commentedFixed.
I thought it does, from my reading of http://api.drupal.org/api/drupal/includes--entity.inc/function/DrupalDef.... Am I misinterpreting something?
FALSE is the default parameter in the function declaration (http://api.drupal.org/api/drupal/includes--common.inc/function/entity_lo...). Is it unwise to rely on this?
Fixed and done.
http://api.drupal.org/api/drupal/modules--system--system.api.php/functio... says it defaults to TRUE.
Fixed and done.
Comment #3
sunIf you step further, then you can see that ->cacheGet() is about the static cache only.
Not unwise, but a bit sparse. That default value is likely going to change for D8, so let's be explicit.
I see. However, let's also be explicit here, since we actively rely on the static caching for performance reasons.
Comment #4
quartsize commentedUpdated, hopefully with all concerns addressed.
Comment #5
sun1) The static should default to NULL, because there can be no profiles yet. Just remove the second argument.
2) Missing space after
ifLet's move these to the top of the .module file, please.
Powered by Dreditor.
Comment #6
quartsize commentedDone, fixed, and done.
EDIT: I suspect if(empty...) is wrong. I'll have to fix that.
Comment #7
sunYup. ;)
Thanks for reporting, reviewing, and testing! Committed attached patch to HEAD. Would be good if you'd have a look at the final tweaks I applied.
A new development snapshot will be available within the next 12 hours. This improvement will be available in the next official release.
Comment #8
twodSay what?? I'm gone for a few days and what happens... profiles are entities? That's......... awesome! XD