Provides a new way of integrating BUEditor into a site based upon input formats and finer control over which textareas that BUEditor appears on. Works totally via API with no modification to the core BUEditor module needed.
Project: http://drupal.org/sandbox/HollyIT/1289922
GIT: http://git.drupal.org:sandbox/HollyIT/1289922.git
Drupal 7
| Comment | File | Size | Author |
|---|---|---|---|
| #15 | drupalcs-result.txt | 7.74 KB | klausi |
Comments
Comment #1
patrickd commentedwelcome
It appears you are working in the "master" branch in git. You should really be working in a version specific branch. The most direct documentation on this is Moving from a master branch to a version branch. For additional resources please see the documentation about release naming conventions and creating a branch in git.
Review of the master branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.
Comment #2
Jamie Holly commentedWent through and got these items fixed. If you could recheck, I would greatly appreciate it!
Comment #3
sutharsan commentedCode review results of bueditor_plus.module file:
drupal_add_js() toadd a javascript file. In Drupal 7 the preferred method in a form context or renderable array context is to use #attached._bueditor_plus_add_js()you calldrupal_add_js()once. Is this to prevent a js file from being added multiple times? No need, drupal_add_js takes care of that.Comment #4
sutharsan commentedChanging state accordingly.
Comment #5
Jamie Holly commentedGot the file comments in.
I dropped the _bueditor_plus_add_js(); and just moved it into the preprocess function.
#attached won't work here. The problem is that this preproccesor function is called after the page array has started rendering and the HTML head already sent to the browser. I originally did try that route and after a couple of hours of pulling my hair out, figured out what was actually going on to prevent it.
Comment #6
sutharsan commentedThe HTML is not sent. Otherwise your drupal_add_js() would not work. As for as I know Drupal sends the full HTML only after it finished rendering.
I see no changes in the other documentation. These may seem silly details, but developers care about code style. It makes code better transferable between developers and with that it supports collaboration.
Comment #7
Jamie Holly commentedOK got those items fixed (eyes still used to look at 6.x LOL). Sorry about that!
On the attached, that does make sense. Probably output buffering dumping out that messed me up. It still doesn't work though. My guess is it has something to do with it preprocessing on a wrapper. I just set up a bunch of traces in the function as well as drupal_render and it looks like the actual wrapper theme never goes through there, meaning #attached is never processed.
I tried adding the JS into child elements, but those have already passed through drupal_render(0 by that time, so they don't get processed either. Looks like the only way to add js in a #theme_wrapper preprocessor is through add_js (same for css).
True this might only apply to text_format_wrapper as there is some weird stuff going on to actually process that wrapper out in filter.module, especially with moving #description and that. Not really sure if that is by design or an actual bug.
The final solution I came up with was dropping the preprocess idea of adding it in and just adding a new #process function to text_format. That is allowing externals to be added through #attached.
Comment #8
sutharsan commentedWell, the purpose of this review is not to make the best possible module, but to make sure it passes the criteria and to help you learn the Drupal API and the Drupal standards. There is always room for improvement.
If you take care of the documentation I will continue with the review of the other files.
Comment #9
sutharsan commentedCode review of bueditor_plus.admin.inc:
The comment says the BUEditor admin page is overridden, but you ADD a definition to admin/config/content/bueditor in the
hook_menu()implementation. Usehook_menu_alter()instead.Use the Local Action UI pattern for the Add new profile link.
':profile'is not an allowed replacement pattern in the t() function. Use%profileinstead.t('This action cannot be undone.')is the default description. It can be omitted.Tip: prefix this comment with 'Menu callback: '. This makes searching and recognizing callbacks easier.
Instead of checking the presence of $profile in every form element (e.g.
$profile ? $profile->name : '') Check once if$profile is NULLand define a default profile.db_query()is not meant to be used for update queries. Usedb_update()instead.Use db_merge() to combine db_update() and db_insert().
Comment #10
Jamie Holly commentedI've done all those changes as well as added a bunch more documentation and a bueditor_plus.api.php file.
On the "Add new profile" issue. I went ahead and changed that menu item to a local action, but I left that actual link in the table as well. The reason behind that is that it follows the UX of BUEditor. I did document that reasoning in the code as well.
Comment #11
sutharsan commentedI found some security faults:
Comment #12
Jamie Holly commentedAdded those in bueditor_plus_admin() and bueditor_plus_profile_form().
Comment #13
sutharsan commentedIf you want to maintain a CHANGELOG.txt make sure you keep it up to date. Personally I can't. So I rely on the issue queue and git log.
Jamie, thanks for your quick reply's and prompt corrections. To me the module is ready, and complies to standards. I hope you feel more comfortable with the Drupal API and are more aware of Drupal's code style and security.
May your hands always be busy, May your code always be used ;)
Comment #14
Jamie Holly commentedThanks a million Sutharsan!
Comment #15
klausiReview of the 7.x-1.x branch:
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. Go and review some other project applications, so we can get back to yours sooner.
manual review:
Comment #16
Jamie Holly commentedGot those changes in. Actually there was access checks on the menu items through the common array. I went ahead and dropped that and just added them in each declaration.
Also dropped the module weight. That really isn't needed now at all like it was in Drupal 6. BUEditor can load after this module as far as it's concerned.
Hopefully the coding is alright. I tried using the online checker but it keeps hanging at 33%.
And wow - didn't notice we are now using param types on documentation! That makes things a lot nicer.
Comment #17
Jamie Holly commentedOK just pushed more changes in. I ended up getting pareview working on my local server, which makes life a lot easier. Getting no errors or warnings now.
Comment #18
klausiSorry, I overlooked the old common array in hook_menu().
Green lights from me.
Comment #19
zzolo commentedHey @Jamie Holly, you now have full Git access. Happy hunting.
Thanks to all the reviewers!
Comment #20
Jamie Holly commentedThanks a million zzolo!