Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Anonymous (not verified)
Created:
12 Jan 2013 at 23:19 UTC
Updated:
2 Aug 2021 at 13:38 UTC
Jump to comment: Most recent
Comments
Comment #1
klausiWelcome,
please get a review bonus first. Then try to fix issues raised by automated review tools:
http://ventral.org/pareview/httpgitdrupalorgsandboxdevdude1887178git
Comment #2
Anonymous (not verified) commentedHi Klausi,
i fixed all the pareview issues.
The review bonus is really great, but i'm actually running out of time. But i will do it later.
Thanks
Comment #3
nikro commentedHi Devdude,
It's a pretty good module. Users of Insert module will definitely like it.
filter.class.inc
Probably you should rename this file to insert_fc.filter.inc as current name has a wide meaning.
Most people will probably use this module within the body field (like I just did), consider adding support for 'text_with_summary' as well.
insert_fc.module
There's a general thing here, make some checks to be sure that this actually IS your modules' replacement token:
In my case it didn't replace the position with field collection item id and $info['eid'] was undefined, which resulted in a crash.
Also consider the fact that other modules also use [[stuff]] and the regular expression you're using will actually grab all of the [[stuff]] patterns (even if they don't belong to your module). I'd recommend you to use some identifier for your replacement tokens and use more specific regular expressions.
Also consider using module_load_include instead of require_once, here:
insert_fc.js
Make sure you get rid of the debugging code:
Also don't forget to comment your code, check Comment Section here: http://drupal.org/node/172169
And also check JavaScript coding standards (in the same link above).
I would encourage you to create an object Drupal.insertFC and extend it like Drupal.insertFC.insertEntity just to make your functions re-usable and namespaced.
So far so good, all-in-all I think you did a good work and this might really be useful in some authoring experience cases.
Comment #4
Anonymous (not verified) commentedHey Nikro,
thank you for your feedback.
filter.class.inc
I've renamed the file and add support to 'text_with_summary' fields.
insert_fc.module
Thanks, i've forgot. In the filter class i already check the type of the snippet. So i do it now in the module file too.
I replaced 'require_once' with 'module_load_include'.
insert_fc.js
I removed all console.log statements, commented my code and create an Drupal.insertFC object.
Thank you for your review. Very helpful.
Comment #5
ain commentedAutomated review
Manual review
InsertFcFilter::posToEid()is not documented properly, @param and @return are missing.insert_fc_field_widget_settings_form()parameters not documented.$textareasin Javascript is only used once, no need to define it at the head of the code block, you could simply do$('textarea').each(…where it's needed. Same is true for$insert_buttons. Also, when you need to define a local variable, it's generally a good idea to define them on location, where they're actually needed so it improves readability. You're doing it ininsertFC.insert().Comment #6
PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application.
I'm a robot and this is an automated message from Project Applications Scraper.