http://drupal.org/sandbox/peter/1509964
Cel approaches templating the way a cel is used in animation. Documented at PeterMoulding.com/cel and in use in several modules across several sites.
Cel is both a supplier of templates to code and through tokens. Cel also supplies useful functions as alternatives to token_replace()
when token_replace() is not flexible enough. Programmers can use the functions. Everyone else can use the templating through any code enhanced by Cel.
Some uses include:
- Fast flexible email templates.
- Replace theme template files with something easier.
- XML file generation.
Reproducing the online documentation here seems a waste. The code is used by other modules to handle templating similar to the way the Libraries API split library access out of WYSIWYG. There is an admin page so you can see what is available without having to reproduce the list in every user module. The code works with Token, Token ex, Token if, and a bunch of other modules.
Is there an alternative? There are some "half way there" modules, including Content templates, but developers are rejecting them for a dependency module because they all have several or more of the following problems. Cel has exactly what is needed for the other modules, no configuration required, a simple admin page to let you see what is available, and full documentation written by a professional writer.
- Are not actively supported.
- Moved to D7 too late.
- Are not designed for use by other modules.
- Do not connect into the relevant parts of Drupal.
Reviews of other projects
http://drupal.org/node/1167022#comment-5596872
http://drupal.org/node/1421554#comment-5596760
http://drupal.org/node/1269194#comment-5598582
http://drupal.org/node/1387212#comment-5598628
http://drupal.org/node/1684898#comment-6900784
http://drupal.org/node/1785088#comment-6903682
Comment | File | Size | Author |
---|---|---|---|
#17 | drupalcs-result.txt | 12.52 KB | klausi |
#1 | 1509964.pareview.txt | 7.63 KB | alesr |
Comments
Comment #1
alesr CreditAttribution: alesr commentedFix the PAReview issues in attachement first.
You can check here is your project meets Drupal coding standars http://ventral.org/pareview/httpgitdrupalorgsandboxpeter1509964git
Comment #2
patrickd CreditAttribution: patrickd commentedIt appears that there have been multiple project applications opened under your username:
Project 1: Cel
Project 2: Unleash the Drupal watchdog in jQuery
As successful completion of the project application process results in the applicant being granted the 'Create Full Projects' permission, there is no need to take multiple applications through the process. Once the first application has been successfully approved, then the applicant can promote other projects without review. Because of this, posting multiple applications is not necessary, and results in additional workload for reviewers ... which in turn results in longer wait times for everyone in the queue. With this in mind, your secondary applications have been marked as 'closed(duplicate)', with only one application left open (chosen at random).
If you prefer that we proceed through this review process with a different application than the one which was left open, then feel free to close the 'open' application as a duplicate, and re-open one of the project applications which had been closed.
Comment #3
NancyDruWhat an awesome sounding module! I think this would solve several problems I have.
Patrick: Do you have a crystal ball that tells you which one would be accepted first? Let's leave this open so it might have a chance to be the one that gets Peterx accepted.
Comment #4
patrickd CreditAttribution: patrickd commentedI'm sorry, but there were several discussions about this on groups.drupal.org.
Multiple applications just double the workload we have, and we have a lot of it.
He can feel free to reopen this one but close the other one.
I closed this one because it was newer and probably take longer then the last one which is already on half way.
Comment #5
peterx CreditAttribution: peterx commentedI closed the jDog application because I am not currently working on it for any project. Cel is in use and I am currently working on code using it. The most painful part will be lowering my coding standards down to camel case.
Comment #6
peterx CreditAttribution: peterx commentedThe Drupal.org instructions tell you to set up your master branch with a single .info file. PAReview says you are not allowed to do that, You have to set up a single README.txt file.
Time warp back to 1980, 80 columns, and the Epson MX-80. I will have to make the code really unreadable to fit PAReview.
Not everything is going bad tonight. The PAReview site uses that awful recaptcha system and one of the displayed bits of text was actually readable.
Drupal says to replace t() with st() in install functions. PAReview says no, do something different.
PAReview says "WARNING | The use of private methods or properties is strongly
| | discouraged, use "protected" instead". Do we just ignore all warnings? Private is a valid choice and there are specific reasons for using private.
PAReview is WRONG here:
"ERROR | PHP4 style constructors are not allowed; use "__construct()"
| | instead"
The other PAReview messages are about using dumpy case and that will break compatibility with all existing modules in all existing sites.
Comment #7
patrickd CreditAttribution: patrickd commentedYes, the problem is that these instructions are somewhere hardcoded in the project module, there are and where discussions about how to finally handle the master branch but this is still not resolved. pareview only suggests you to leave a readme rather then a single info file because many people were confused were the actual code is.
Also the 80-character per line issue should rather be understood as suggestion, if the code is going to look ugly because your following coding standarts that's really not the sense. We wont force applicants to follow all coding standarts perfectly, just whenever possible. (You can point people to this comment if they keep annoying you about it ;) )
I added some additional security checks to the pareview service client yesterday, so the captcha is (hopefully) not needed anylonger. I turned it off because many people were annoyed about it, so lets see if it is actually necessary.
The other issues are from drupalcs, please go ahead and create an issue about these points in its issue queue. Maybe your right and there's something to change, maybe you and me just don't know the reasons for these.
As said, take coding style as suggestion rather then policies, but whenever you can, follow them to help making code on drupal.org consistent.
thanks
Comment #8
peterx CreditAttribution: peterx commentedCels are now available as blocks. Some sites use them because they get a nice range of tokens to use in the text. The current version in the sandbox makes all cels into blocks. I will eventually copy in code from another version that lets you specify the block option by node, via an extra field.
Comment #9
Novalnet CreditAttribution: Novalnet commentedHi,
Manual Review :
1. Please use t() and placeholders for the description in cel.module line 75.
2. It seems you calling the cel_display_name() inbetween strings.Better you return the value to variable and use placeholders to use them.
3. Please avoid using HTML inside t() in line 129 of cel.module.
4. In cel_log() you are using Placeholders without t().It can be better if you enclose it.
ex:cel_log(t("abc"));
5. Use l() to create link markup instead of creating by your own in cel.install line 32.
6.It seems PAREVIEW contains some errors.so please get it cleared.
Thanks,
Comment #10
peterx CreditAttribution: peterx commented@Novalnet,
1 I added t() for the description.
2 Changed.
3 HTML removed.
4 t() added inside cel_log() for type and message. t() not added to variables going into messages because they are diagnostic and need the original machine name, or similar, untranslated.
5 Done.
6 I change everything to fit Coder, including warnings, then commit then PAREVIEW. Unfortunately Coder does not report everything and PAREVIEW reports some things that are different to some of the Drupal documentation pages.
Comment #11
peterx CreditAttribution: peterx commented45 | ERROR | PHP4 style constructors are not allowed; use "__construct()"
| | instead
The error message is wrong. The class uses __construct().
Comment #12
peterx CreditAttribution: peterx commented32 | ERROR | Do not use t() or st() in installation phase hooks, use $t =
| | get_t() to retrieve the appropriate localization function name
First it says to use st() instead of t() then after the change it says to use $t.
Comment #13
peterx CreditAttribution: peterx commentedAll the PAREVIEW changes changed. Backward compatibility is wrecked, as is compatibility with non Drupal versions. I hope there is a benefit for someone somewhere.
Comment #14
apadernoComment #15
peterx CreditAttribution: peterx commentedSome more sites are now using this. Testing of the install on those sites improved the install code with more checking of existing settings.
Comment #16
peterx CreditAttribution: peterx commentedPAReview still incorrectly reports an error. Apart from the one mistake by PAReview, I cannot find any error. The sites using Cel have no errors. The test pages test every function individually and in sequence without any errors. There are no code problems with PHP 5.3. The code works with Drupal from 7.9 through to 7.14. The memory usage is microscopic compared to traditional Drupal code. Several sites are now waiting on the module because their policy is to only use formally released drupal.org code.
Comment #17
klausiSorry for the delay, but you have not listed any reviews of other project applications in your issue summary as strongly recommended in the application documentation.
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
Review 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. You have to get a review bonus to get a review from me.
manual review:
<script>alert('XSS');</script>
as Cel content then I get a nasty javascript popup when the block is displayed. Anyone with the "Cel: Create new content" permission (or similar) can inject potentially malicious script stuff. See http://drupal.org/node/28984Comment #18
peterx CreditAttribution: peterx commentedClass renamed to bumpy case. Master branch removed. Version removed. Working through other code format changes.
Comment #20
klausiYou need to set the status to "needs review" if you want to get a review.
Don't forget to add the "PAReview: review bonus" tag as indicated in #1410826: [META] Review bonus, otherwise you will not show up on my high priority list.
And please add all your reviews to the issue summary.
Comment #21
peterx CreditAttribution: peterx commentedPAReviewed down to one message, a message that does not apply because the constructor has the correct
__construct()
name.ERROR | PHP4 style constructors are not allowed; use "__construct()"
| | instead
Comment #22
klausiPlease don't remove the security tag, we keep that for statistics and to show examples of security problems.
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #23
peterx CreditAttribution: peterx commentedmethod cel(): This is basic to all versions of the code, including the Drupal version, across all applications and Web sites. If changing this is a requirement, I will go back to using the original cel code from a library.
t($name): Strings changed to t('...@name...', array('@name' => $name)).
Please add all your function documentation inline in code, you can generate HTML for your pages with doxygen:
Doxygen does not handle images and all the things you put into documentation. Doxygen is a 1980s approach, not a Web approach. The rest of the documentation already exists in other forms and will going online, not locked into code.
Comment #24
peterx CreditAttribution: peterx commentedWhat is the PAReview: security tag for? There are no security issues. A cel is content. If having content in a Web site is a security issue, all nodes have to be banned.
Comment #25
klausiSorry for the delay. Make sure to review more project applications and get a new review bonus and this will get finished faster.
manual review:
<script>alert('XSS');</script>
as Cel node title a get a nasty javascript popup at admin/config/system/cel_admin. You need to sanitize user provided text before printing, please read http://drupal.org/node/28984 again.The security issue is of course a blocker. The tag is used for statistics and to show examples of security problems.
Comment #26
peterx CreditAttribution: peterx commentedhttp://drupal.org/node/1684898#comment-6900784
http://drupal.org/node/1785088#comment-6903682
Comment #27
peterx CreditAttribution: peterx commentedcel.admin.list.php removed. Left over from before the creation of the admin module.
Cel admin is now a separate project because most sites will not need it.
The documentation pages will be moved to drupal.org pages when the module is published. Drupal.org does not allow child pages off the sandbox page. I have not found an example of a sandbox project documented in the documentation section of drupal.org.
Comment #27.0
peterx CreditAttribution: peterx commentedAdded list of done reviews.
Comment #28
peterx CreditAttribution: peterx commentedPareview does not show any errors in the code. It lists only the incorrect message about PHP4 constructors. The security tag is no longer relevant because the questioned code is in a separate project.
Comment #29
robinvdvleuten CreditAttribution: robinvdvleuten commentedAutomated Review:
You say that there is only an issue here about a PHP4 constructor. The minimum PHP version of Drupal is 5.2.5 (http://drupal.org/requirements) so why do you have PHP4 style coding here?
Manual Review:
Comment #30
peterx CreditAttribution: peterx commented@robinvdvleuten, thank you for the review.
Re PHP4 code. I do not have PHP code, it is a mistake in Pareview. I have a PHP5 constructor, __construct(), then I have a function with a name that might be interpreted as a constructor in PHP4. Pareview should be updated for PHP5, look for __construct(), then skip the PHP4 constructor check.
Re function returning the module's name. I write many modules in a way where the code can be reused by other modules. Cel could be reused by someone creating a different templating system. For that reason I place data, including names and identifiers, in one place where the programmer can make one change in the copied code. For classes, I often accept the data from outside so other modules can reuse the class without changing the code.
I will remove the quotes from the .info file. Just a habit from the early days of .ini files.
I will look at the URL. I will move the documentation to Drupal.org when the module is published, which will change all the URLs.
The purpose of the module? It is the base for other modules performing templating. It is packaged in many sites with something else to provide specific templating for mail and other uses. There are now so many add-ons for Cel that I separated them out so people can load exactly what they need and nothing else. Cel twig uses Cel and Twig7 to provide twig based templating. There is a module to use Cel twig for mail templating. There was an admin module packaged with Cel to you can administer all the different cels for the different modules then I moved it to a separate project because most sites using cels administer cels through the content pages or the module using the cels.
Re new content type. Templates are content to editors. The node containing the cel documents the cel. You can use the content body to document the template. You can use comments for feedback. The node is left user modifiable so you can add your own identifiers and classifications. You can use other modules, including Workbench, with cels.
I would like to change the code, readme, and documentation now that I have moved the admin module out to a different project but there is a new release already out among the sites using Cel. I do not see the sense in making minor changes to the version in the sandbox when everyone will be using the new version before the old version is published. Submitting the new version also creates a problem, the new version will go back to waiting for review until after it is obsolete.
Comment #31
ain CreditAttribution: ain commentedAutomated review
Cel
whilst you also have a protected property calledcel
. This overlap is the cause of this behaviour. Whilst it's not entirely incorrect, it's still bad practice. Code should always be readable and without even digging into the code, question is what is what? The class is Cel and the property is also cel? Please consider a better naming convention.Manual review
@param
,@return
missing forcel_tokens_cel()
// Why custom? Document.
use standard TODO, FIXME or XXX comments, e.g.// TODO: document
or@todo …
in function doc.Recommendations
Cel::cel()
. Maybe it's not a problem in the circumstances, but how do I set a property to null? It's a good practice to usegetSomething()
andsetSomething()
, robustly.getLastItemOfDataCollection()
tolast()
which often says absolutely nothing.Comment #32
PA robot CreditAttribution: 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.
Comment #32.0
PA robot CreditAttribution: PA robot commentedUpdate of reviews list.
Comment #33
apaderno