This module provides an input filter which can be used by content authors to insert Go game diagrams into their content by defining a diagram in text within [godiagram]...[/godiagram] tags. This text is converted to an image automatically which is then used to replace the source text.

I have created a demonstration site which shows the module working and allows people to try it out.

I don't believe that there are any other modules which currently provide any support for inserting Go game diagrams at all.

The actual work of converting the source text to an image is handled by a 3rd party library which is accessed through the Libraries API module. One thing to note with the usage of this 3rd party library is that it uses the PHP split() function which is deprecated and therefore causes warnings to be shown within Drupal. I have noted this in the README.txt and suggested that these warnings can be hidden from the Drupal configuration.

Note: I'm currently working on some reviews of other applications in order to get a review bonus. Other applications reviewed so far:

Comments

marshmn’s picture

Status: Active » Needs review
marshmn’s picture

Issue summary: View changes

Info about other applications reviewed so far

marshmn’s picture

Issue summary: View changes

Added to list of application reviews

marshmn’s picture

Issue summary: View changes

Add another application review link.

marshmn’s picture

Issue tags: +PAreview: review bonus

Since I've now manually reviewed some projects in the project applications queue (see edited issue above for links to these reviews) I'm going to add the "PAReview: review bonus" tag to this application. I will continue to review other applications in the queue as best I can.

shawn_smiley’s picture

Status: Needs review » Needs work

Interesting module. Thanks for contributing it. There are just a couple minor adjustments that I'd like to see implemented.

The define constants should be namespaced. For example, instead of define('DIAGRAM_FILTER_TAG', 'godiagram'); you should have define('GODIAGRAM_FILTER_TAG', 'godiagram');

See the section on comments in http://drupal.org/coding-standards/#naming

The content of the function documentation comments are good, but the documentation is missing for the function arguments and return values. See http://drupal.org/node/1354#functions.

In function godiagram_process_diagram_text(), you should use file_default_scheme() rather than having a hard coded "public://" for those cases where the user has configured the private file system as the default.

marshmn’s picture

Status: Needs work » Needs review

Thanks for the review and the pointers Shawn_Smiley, all good comments.

I've committed some changes which address each of the items you pointed out:

  • All define constants have now been prefixed with GODIAGRAM_
  • Function header comments have all been improved by adding @param & @return items
  • File stream type is now taken from file_default_scheme() instead of being hard-coded

I believe therefore that this module is now ready for review again.

groupdocs’s picture

Status: Needs review » Needs work

There are a few things that can be done to improve this module after passing it through pareview.

Your results from running through it are here: http://ventral.org/pareview/httpgitdrupalorgsandboxmarshmn1602068git

Is it not better to use date types on return as it presented here:
http://drupal.org/node/1354 (Data types on param/return)

Maybe it will be batter to provide step-by-step installation instruction to those for whom "Text format" is not well known.

Also on my configuration this plugin is not working, with no errors (just about deprecated split()).
I posted:
[godiagram]
$$ A joseki mistake
$$ ------------------
$$ | . . . . . . . . .
$$ | . . 8 . . . . . .
$$ | . . 4 5 . 2 . 3 .
$$ | . . 6 1 . . . . .
$$ | . . 7 a . . . . .
$$ | . . . . . . . . .
[/godiagram]
and get only "A joseki mistake" in node content.
Will try to figure out why it's not working.

Update:
The issue was in wrong "Text format" settings that I made.

Update2:
I can't find any similar module.
This module use SL Txt 2 PNG library that is under GPL licence. According to http://drupal.org/node/422996 you may try to commit this library with you module with some changes to avoid error with deprecated split() function. Or you may try to contact with library's developers with your fixes of their code.
Can't find any security issues.
Module accords to Drupal coding standards.

marshmn’s picture

Status: Needs review » Needs work

Thanks for the review, groupdocs.

I forgot to run the module through the pareview script after the last changes so I see now that I should specify those data types in the function headers as you say. Whilst looking at the coding guidelines further I can see that I'm not using the recommended way of documenting the hooks and callbacks either. I'll make changes to fix these issues.

I can add some extra documentation in the README.txt to explain better how to setup the filter. I suppose I wasn't sure of the balance I should be getting between giving clear instructions and not duplicating other core Drupal documentation. I'll take a look at some other filter modules and see what they do.

Glad that you found the problem you were having!

Thanks again for the review. I'll fix the above issues and then I'll set this back to 'needs review'.

marshmn’s picture

Status: Needs work » Needs review

I've committed a few changes to address the above issues:

  • Updated function header documentation to include data type information with @param & @return items
  • Removed un-necessary @param & @return information from hook implementation function headers
  • Changed the names of a couple of callback functions as I noticed they weren't following the naming conventions correctly
  • Updated the README.txt to add more information about configuring the module
  • Ensured that no errors are returned from the pareview script

I believe that this fixes all the problems that have been raised so far so I'm setting this issue back to 'needs review' again.

bartlantz’s picture

Status: Needs work » Reviewed & tested by the community

This looks RTBC to me. Very interesting module. I love functionality like this.

Here are my manual review notes:
1. Module is not a duplicate. Very interesting module!
2. 3rd Party Libraries are included with libraries module. Its a shame that
the split() issue can't be fixed in the library.
3. Module contains good documentation and a great demo.
4. Module contains a good example for testing output as well.
5. Module contains good comments in code.
6. Module passes coding standards.
7. Module is using Drupal APIs correctly.
8. I do not see any security issues.

The one thing I would consider changing in the future is to put an underscore in front of the internal, helper functions so that they are not mistaken for drupal hook functions. For instance rename godiagram_load_libraries() to be _godiagram_load_libraries(). But that is a minor issue and everything looks solid.

Thanks,
Bart

klausi’s picture

Issue tags: -PAreview: review bonus

Review of the 7.x-1.x branch:

  • Drupal Code Sniffer has found some issues with your code (please check the Drupal coding standards).
    FILE: ...rupal-7/sites/all/modules/pareview_temp/test_candidate/godiagram.module
    --------------------------------------------------------------------------------
    FOUND 1 ERROR(S) AFFECTING 1 LINE(S)
    --------------------------------------------------------------------------------
     106 | ERROR | ISSET keyword must be lowercase; expected "isset" but found
         |       | "isSet"
    --------------------------------------------------------------------------------
    

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. You have to get a review bonus to get a review from me.

manual review:
godiagram.module: constants should be at the top of the file.

But otherwise looks RTBC to me. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.

marshmn’s picture

Bart,

Thanks for the review and for the kind comments about the module!

I agree that it would be better if the library would fix the deprecated split() issue... I think I will create a patch for the library and submit it to them to see if they will include it in a new release.

I take on-board your comment about prefixing the helper functions with a leading underscore - I will make a change to address that.

Thanks again for your review & comments,
Matt

marshmn’s picture

klausi,

Thanks for your review.

I will make changes to address both of those points - both make sense.

I will then look to do some more reviews to get the review bonus again.

Many thanks,
Matt

marshmn’s picture

Issue summary: View changes

Add another project application review link

marshmn’s picture

Issue summary: View changes

Add further review link

marshmn’s picture

Issue summary: View changes

Added another review link.

marshmn’s picture

Issue tags: +PAreview: review bonus

I've commited changes for the above issues, and since I've now completed 3 more reviews of other project applications I am adding the review bonus tag again.

Thanks,
Matt

shawn_smiley’s picture

I'm going to give a +1 on the RTBC as well.

There is one very minor issue that I don't think should prevent the release. In godiagram.module line 238 you have an empty else {} block that should be removed.

Also as a future enhancement, I would suggest implementing hook_requirements() to run a check to verify that the "SL Txt 2 PNG library" library is installed correctly. See http://api.drupal.org/api/drupal/modules!system!system.api.php/function/....

Robin Millette’s picture

Regarding hook_requirements and libraries module, have a look at #1600676: libraries_get_path() is unsafe in hook_requirements() in install phase, and will cause installation to fail since the libraries_get_path() function might not be available at install time.

Thanks for this new module :-)
Happy Drupaling!

marshmn’s picture

Hi,

Thanks for pointing out the empty else{} block - I shall remove that.

Regarding the hook_requirements() - I shall look into that. I think I've seen different modules doing slightly different things when checking for existance of external libraries - some seem to prevent enabling the module until the requirement is met where as others seem to allow the module to be enable but then report an error in the status reporting, so I'm not sure which is best practise? I guess since the external library is fundamental to the workings of this module it would make sense to do the check and prevent the module for being enabled. I will implement this.

Thanks for the reviews!

Matt

marshmn’s picture

I've now implemented hook_requirements() to check that the library is installed and can be found at the required location.

Also cleared up the empty else{} block.

patrickd’s picture

Status: Reviewed & tested by the community » Fixed

.install: Don't use concatenation ('string' . 'string') within t() function!
The translation system at localize is only able to find and translate complete, static strings (eg. t('I am translatable') - t('I am' . 'not'))

But there are no serious issues

Thanks for your contribution!

I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.

Here are some recommended readings to help with excellent maintainership:

You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!

Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

Thanks to the dedicated reviewer(s) as well.

marshmn’s picture

Thanks for the review patrickd. I've commited a change to fix the incorrect usage of concatenated strings within t().

Thanks also for updating my account to allow me to make this a full project - I've now done this and released an alpha version of the module.

Huge thanks to all who helped review this application - all the comments were very helpful!

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

Add further review link.