Advanced Entity Tokens (AET) exposes your site's entities to the token api.

Project Information

Project Page
git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/EyalShalev/1664648.git aet

Target Core is Drupal 7.x

Similar Modules

There were only two modules that I could find with similar purpose: Entity Embed & Entity Token Filter. Both are sandboxed and don't look much alive.

Another similar module is node_embed that adds a filter that can embed nodes. AET is diferent from node_embed by using the already existing token api and a more generic (and D7) approach - Entities.

Known Issues

  • Entity Recursion:
    Entity Recursion can happen if I insert the [aet:node:1] tag inside the 1st node.
    I tried to handle this by creating a function that checks if the entity is the main page content but it won't cut it. Right now I'm thinking about using function cache to check if this entity has already been loaded.
  • Better hook_token_info implementation.
    I want to list all the entities and their properties but when I view all the tokens it just looks messy.
    If someone here can propose a better way to implement the hook I'd be glad.

TODOs

  • Add GUI to WYSYWYGs

Reviews

P.S. I am working on reviewing more projects.

CommentFileSizeAuthor
#11 drupalcs-result.txt1.9 KBklausi

Comments

j2r’s picture

Status: Needs review » Needs work

There are Many Drupal coding standard issue. Please look at the link

http://ventral.org/pareview/httpgitdrupalorgsandboxeyalshalev1664648git-...

eyal shalev’s picture

Thanks J2r,

Tough on first impression most of the errors relate to spacing before the comment line and whitespace :)

eyal shalev’s picture

Status: Needs work » Needs review

There are Many Drupal coding standard issue. Please look at the link

All of the errors (except one in the info file) were fixed.

The remaining warnings relate to exceding 80 chars by a small number (low proirity as I see it)

The Error in the info file claims that I don't declare the name property which is very odd because as far as I can tell I do declare it.
I tried encalpsing the name in qoutes but nothing.
I would very much appriciate anyones help in this issue.
It seems that when the info file is encoded with UTF-8 there is a proplem reading it. converting it to ANSI fixed the problem.

eyal shalev’s picture

Issue summary: View changes

added the review on http://drupal.org/node/1676528

eyal shalev’s picture

Issue summary: View changes

Added Article jump review

eyal shalev’s picture

Issue tags: +PAreview: review bonus
cthiebault’s picture

Automatic review

Add @file block to aet.tokens.inc and aet_view.tokens.inc.
See http://drupal.org/node/1354#files

Also there should be no trailing spaces.

Manual review

  1. You could add "package" to you .info files to group your modules under the same package. It would be easier to find and enable them.
  2. Typo in aet.tokens.inc, line 91, 151, 296 and aet_view.tokens.inc line 73: santize instead of sanitize.
eyal shalev’s picture

@cthiebault,

Thanks for the review.

I decided that the AET View submodule was unnecessary so I removed it and reincorparated its functions to the AET module.

The main Token module doesn't use a package so putting my module under a Token ackage seems a bit odd (I did it anyway).

The typos are fixed as well.

P.S.
I know it's a lot to ask but I would like to hear about the expierence of using the module, are there any bugs? Is the recurssion fix working?

Regards,
Eyal

cthiebault’s picture

I tried quickly with Token example... but I need a more real use case.
I'll do it tomorrow.

Cedric

eyal shalev’s picture

@cthiebault,

A good use case can be inserting a node inside a block.

If you need help implementing this you can contact me.

Regards,
Eyal

Enxebre’s picture

Status: Needs review » Needs work

Hi Eyal Shalev,
After a quick review I just can tell you that users would be grateful if you had time to implement hook_help()

/**
  * Implement hook_help()
  */
function yourmodulename_help($path, $arg) {
switch ($path) {
case 'admin/help#yourmodulename':
   $output = '';
   $output .= '<h3>' . t('About') . '</h3>';
   $output .= '<p>' . t("A helpful entry about your module") . '<p>';
return $output;
   }
}

Thank you!

patrickd’s picture

Status: Needs work » Needs review

hook_help() is absolutely no requirement - therefore no major issue - therefore no reason to set needs work

klausi’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -PAreview: review bonus
StatusFileSize
new1.9 KB

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

  • ./README.txt: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.
  • ./aet.module: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.
  • ./aet.tokens.inc: the byte order mark at the beginning of UTF-8 files is discouraged, you should remove it.
  • Drupal Code Sniffer has found some issues with your code (please check the Drupal coding standards). See attachment.

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:
"$info['types']['aet']['description'] = t('AET Description');": not a very useful description?

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.

mitchell’s picture

Title: Advenced Entity Tokens (AET) » Advanced Entity Tokens (AET)
Status: Reviewed & tested by the community » Fixed

Thanks for your contribution, Eyal Shalev!

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 stay involved! Thanks again, and good luck! :)

eyal shalev’s picture

Thanks klausi, mitchell, Patrickd & Cedric for all your help.

This is now a full project thanks to you.

eyal shalev’s picture

Status: Fixed » Closed (fixed)
eyal shalev’s picture

Issue summary: View changes

Edited the reviews urls