The adlibapi module is a new module which enables Drupal to connect to museum database software 'adlib' by adlibsoft.
The basic module provides api functions, as well as connection settings for an unlimited amount databases (using ctools).
Based on the api module, other modules can perform different tasks:
- adlibapi_feeds: Feeds integration allows to synchronize the adlib data to Drupal nodes with cck fields
- adlibapi_image: Allows to retrieve images from the adlib image server at node load.
The strength of the module lies in the use of other modules to perform specialized tasks.
Configuration of the databases is achieved by the ctools export ui, so database settings can be exported.
Synchronization is done by the feeds module, which is an excelent import tool.
The basic communication with the adlib server is handled by specialised classes which are general php classes and could be used in any PHP project.
The classes are now included in the module, but could later be supplied as stand alone, using the library module.
Sandbox: http://drupal.org/sandbox/jurcello/1072526
Git clone command: git clone --recursive --branch 7.x-1.x http://git.drupal.org/sandbox/jurcello/1072526.git adlibapi
Reviews of other projects
| Comment | File | Size | Author |
|---|---|---|---|
| #41 | Screen Shot 2012-11-19 at 9.59.34 PM.png | 93.8 KB | cwithout |
Comments
Comment #1
jurcello commentedAt the moment the module is build in 6.x. A 7.x version is developed, which only needs the parser to be ported.
Comment #2
avpadernoHello, jurcello. You need to create a sandbox project, and provide a link here.
Comment #3
jurcello commentedThe project is at this location:
http://drupal.org/sandbox/jurcello/1072526
Comment #4
jurcello commentedComment #5
svendecabooterHi Jur,
Here are a few notes after a quick scan of this module:
// $id$and; $Id$CVS tags from your .info & .module filespackage = Triquantashould be more descriptive, e.g.package = Adlib, or be removed at all (so modules can go into "Other")When I find some more time I might review this module in greater depth. Looking forward to seeing it released!
Sven
Comment #6
jurcello commentedHi Sven,
Thanx for your quick scan. I will look into it!
Jur
Comment #7
jurcello commentedI solved most of these issues. The module is ready for test now.
Comment #8
jthorson commentedUpdating priority according to the new project application priority guidelines. The application's priority should be set back to normal once a reviewer responds to your application and the application review process has continued.
Comment #9
hanskuiters commentedI am really interested in this module. Where can I donwload it for testing?
Comment #10
jthorson commentedcapono:
Using Git:
Click the sandbox link (http://drupal.org/sandbox/jurcello/1072526), and then click 'version control' for instructions.
Without Git:
Click the sandbox link (http://drupal.org/sandbox/jurcello/1072526), and on the bottom right click 'Repository Viewer'.
Then choose the version you want under the 'Heads' section, click tree, and click snapshot.
Hope this helps!
Comment #11
hanskuiters commentedjthorson: thank you, I found it.
Seems to be a lot of work has been put in this module and it looks good. Unfortunately it is not the way we want to use it. We just started to test the new jQuery connector. So we will not import the data into Drupal.
Edit: typo
Comment #12
sutharsan commentedI see no commit of your #7 work. Checked out from git.drupal.org but only found the initial commit:
Comment #13
jurcello commentedThe master branch is not used anymore. There are two four branches: 7.x-1.x-dev, 7.x-1.x, 6.x-1.x-dev, 6.x-1.x
These can be found here: http://drupal.org/project/1072526/git-instructions.
Either the 6.x-1.x or 7.x-1.x can be used.
Comment #14
jthorson commentedChanging status, so that this doesn't stagnate ...
Comment #15
jthorson commentedJurcello,
Did a look through the 6.x version of your module:
$dummy = 'dummy';... why?Example (from adlib_references_functions.inc, line 31): Can you guarantee that $node->title is safe, and not something like "
<script>dobadthings()</script>"?$message= "Last updated node in current step: ". $node->title ." (nid: ". $node->nid . ").";I suspect the above is susceptible to an XSS attack.
Comment #16
jthorson commentedComment #17
misc commentedjurcello has been contacted to ask if the application is abandoned.
http://drupal.org/node/894256
Comment #18
jurcello commentedThe project is not abandoned. There was just not enough time to work on it. I will update the code as soon as possible.
Comment #19
misc commentedComment #20
jurcello commentedCould someone test this again?
To test, use the 7.x-1.x-dev branch and use the README file to create a feeds importer.
Comment #21
jurcello commentedComment #22
klausiWe are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #23
caiovlp commentedI performed a quick code review and found several indentation and other coding standard issues. Also noticed that there is an empty test.info file in one of the sub-modules. I strongly recommend you to use the tool below to identify and resolve all coding standard and other major issues before submitting your project for review again.
http://ventral.org/pareview
Comment #24
jurcello commentedThanks for reviewing. I started fixing the issues from the tool mentioned in comment #23. The branch to test will be 7.x-1.x.
Comment #25
jurcello commentedComment #26
klausiYou need to set the status to "needs review" if you want to get a review. See http://drupal.org/node/532400
Comment #27
jurcello commentedI know, I was not finished fixing the issues yet. I will fix them as soon as possible.
Comment #28
jurcello commentedWhen I use the automated testing in #23, there are many errors that have to do with phpdoc comments. For some strange reason it keeps telling me there are things wrong, which are right if I lool at it.
12 | ERROR | Return comment must be on the next line
32 | ERROR | Parameter comment indentation must be 2 additional spaces at
| | position 1
What should I do with this information. It seems impossible to fix these 'errors'.
Comment #29
patrickd commentedcoding style issues have secondary priority, common code of any project will probably never follow every standard 100%. but we are HAPPY if your at least trying to do it perfectly! ;)
Comment #30
jurcello commentedI resolved almost all coding standard things.
Can a review be done on the code now, rather than on the coding standards?
Comment #31
patrickd commentedComment #32
patrickd commentedYour project page is not very detailed / looks a little unstructured, please have a look at the tips for a great project page, you may also use HTML-tags for better structure.
An automated review of your project has found many issues with your code; As coding standards make sure projects are coded in a consistent style we please you to have a look at the report and try to fix them. Anyway, note that issues found are possibly false positives and fixing all issues is not a requirement for getting through the application process.
Automated review: http://ventral.org/pareview/httpgitdrupalorgsandboxjurcello1072526git
Please read about Coding standards (http://drupal.org/coding-standards) and doxygen standards (http://drupal.org/node/1354)
There are about 100 other applications waiting for review and only a hand full of active reviewers.
We do really need more hands in the application queue and highly recommend to get a review bonus so we can come back to your application sooner.
Comment #33
patrickd commentedComment #34
jurcello commentedI'm getting a bit frustrated right now. I spend almost a day of fixing coding standard issues.
The only coding standard issues that are left are minor comment issues. I will fix all the remaining coding standard issues, except for the camelCase things in classes.
According to the coding standard documentation, camelCase should be used in classes, so I regard this as a false positive.
As I mentioned in an earlier reply, I want a review of the code, not of the comment coding standards. Of course I could remove all comments, so there are no issues there, but I don't think thats the idea of a project application review. Till now, I have not even had 1 comment on the code itself. It looks like nobody looked at it at all.
Furthermore, in comment #32 the following is said:
If you have a closer look, there are almost no issues with the code (except for the camelCase thing).
So please have a look at the code itself. I'm waiting for more than a year now.
Comment #35
jurcello commentedOk, I fixed all coding issues (including camelCase):
Automated review: http://ventral.org/pareview/httpgitdrupalorgsandboxjurcello1072526git
There are 2 issues left and both are false positives:
I did this, so I assume this is a false positive.
This is intentional. I want to display the link path. This path should not be translated.
Comment #36
caesius commentedThis one isn't a deal-breaker, but:
This should ideally look like this, since links in the UI should usually have descriptive text, particularly if it's an internal URL:
Also, I manually went through the rest of the code and found no issues with regard to Drupal API usage or other coding standards. However I then went through the readme and on the "Save the settings" step I get these notices:
Your code should not be giving notices even if most people will not see them; please use !isset($this->_error).
Also, after selecting the Adlib parser I was getting errors that said "Adlib parser: No mappings are defined." I haven't even gotten to the part where I set these mappings yet, and while I understand that you want to remind the user to do this step you should not be throwing errors around like this.
I also got a strict warning once I actually got to the mappings page:
I do not have an Adlib database so I was not able to progress past the "Create mappings at the processor" step. I will assume that it works fine after that point, but you should enable all error logging on your development site and fix any notices that you find, just in case.
Once you've done all this I think this project will be ready for promotion.
Comment #37
jurcello commentedThanks for the review! I will look at it as soon as possible.
Comment #38
jurcello commentedI fixed all the issues mentioned in #36. Furthermore I enabled all error logging and fixed all messages.
Comment #39
jurcello commentedComment #40
klausiThis application is not fixed? See http://drupal.org/node/532400
Comment #41
cwithout commentedVerified the automated code review results. It checks out
I installed and followed the steps in the readme. I didn't get any error messages.
But I wasn't able to successfully complete all the steps. I could only get to the step "Now first create the mappings at the processor (select an adlib expression)". There were no fields to map. (See attached screenshot.)
The instructions give the impression that I should be able to complete the steps using the "adlib_sandbox" as the database. Should I be able to? If I should, there is an issue. If I shouldn't, the readme should be updated to reflect that.
The project page could use some work. It looks pretty unstructured. For Drupal users who aren't familiar with adlib, a brief layperson's description or example of what they could with this module and the adlib software would be nice. (That would fall under the "overview" section of the project page.) See Tips for a great project page.
Comment #42
gregglesAdding the security tag based on comment 15. I believe I also found potential XSS via the watchdog of an error message from the connection process. It seems ideal to use the ability of watchdog to do filtering and add context to the message like:
I only reviewed via the web so I didn't do an exhaustive review, but I couldn't find where theme_adlibapi_render_database_info is being called. Depending on where the rawtext and fieldname variables are coming from they should be similarly filtered by a function like check_plain or filter_xss.
In the ctools export code it seems that a user supplied url is used without validation. The url function seems like it could be handy (or more specifically drupal_strip_dangerous_protocols). I didn't trace through 100% to see where the result is being used, though, and perhaps the value is being filtered by something like url() on output, which is totally valid and appropriate.
Feedback that shouldn't block promotion:
This error message is not very easy to read and take action. I suggest adding a link to the place someone can configure the database and maybe using the word "adlib" to describe what kind of database. In that same function, you are currently returning FALSE on a fail or the populated connection. It might be a good spot to throw an Exception instead of returning FALSE.
Where is the errorstring used? I note two things with that line: it's not being translated using t and there's a typo "address" instead of "adres"
I see you're using CURL instead of drupal_http_request. Is there a reason to use CURL? If so a comment in the code explaining the reason would be helpful. If not, it would be nice to switch to gain compatibility on systems where CURL is not installed.
Comment #43
jurcello commentedThanx for testing again!
In respond to comment 41:
you need to define some mappings at the processor first. This is confusing, so I now added a warning message if no mappings are defined. The message contains a link to the page where the mappings should be defined.
Furthermore I will work on the project page soon.
In respond to comment 42:
- I fixed the watchdog message
- The theme adlibapi_render_database_info is used in the file adlipapi_ctools_export_ui.inc file in order to show information about the database. I now sanitized all the variables.
- About the url: I validate it now in the AdlibConnector class.
- I changed the strange error message. I now provided a link to the page on which to alter the database.
- The errorstring can be used by other functions which receive the response. It is mainly used for messages to the watchdog. I added the t function.
- I commented the use of curl in the code.
Comment #44
cwithout commentedThanks for making the updates jurcello. You've obviously been putting a lot of work into this module. I followed the instructions in README and was able to create a feed and import content. Then viewed the import log and successfully deleted all imported content. I got a bunch of nodes that had titles empty, but saw the README states the title in the sandbox may not always be populated. So it appears to be working as expected.
With the functionality down, I moved on to look at the code.
D7 code
AdlibFetcher.inc
In the first function call,
$response->getErrorMessage()is not escaped before output. In the second, it is. So I checked to see if it should be escaped and found the values of$response->getErrorMessage()can be populated by external XML data. So #42 is correct, it is a possible XSS. I see you made the correction for #42, but you should also sanitize$response->getErrorMessge()before sending to drupal_set_message().Change the
drupal_set_message()call to:adlibapi.apifunctions.inc
You missed one. It should get sanitized the same as you did in AdlibFetcher.inc. (And probably change
'adlibapi'to yourADLIBAPI_WATCHDOG_ERRORconstant. Though that's not something that should hold up promotion.)AdlibSearchResponse.php
You don't wrap the value of the
errorStringproperty in t() but do so in other places.$this->errorString = "Query did not return valid XML";Should change to:
$this->errorString = t("Query did not return valid XML");ad-libapi.module
This shouldn't block promotion, but you might also want to use your constant
ADLIBAPI_WATCHDOG_ERRORinstead of'adlibapi'in the watchdog() call.D6 code
The Drupal 6 code has lots of places where the output needs to be sanitized. Start by doing a search in your code for
watchdoganddrupal_set_message.Make sure you follow the same convention as you did to fix the watchdog message in response to #42.
Example:
Should be:
Note about that particular line of code in ad-lib_image.module. You also have a parenthesis out of place. You're passing 'error' to t() instead of drupal_set_message().
Comment #45
jurcello commentedThanx for reviewing!. I solved the mentioned security issues and removed the 6.x-1.x branch. I will backport the 7.x-1.x changes when I have time, but for now it is more save to remove the entire branch.
Comment #46
sprocketman commentedI just did a quick review of your module and just had a couple of quick comments. Overall, the code looks clean and straightforward. You have date_popup as a dependency for the adlibfeeds module, but that is actually in the Date module now. So I think you want that dependency changed to Date, as you have it written in your README.txt file. Also, it looks like Coder is still outputting a few code-related warnings, many of which recommend using count() instead of sizeof(). Also, in line 272 of adlibapi.apifunctions.inc, make sure to use check_plain() on your $link variable. Good luck!
Comment #47
_wdm_ commentedReviewing the 7.x-1.x branch.
Automatic Review:
It helps if you can use one of the automatic code style checkers, or alternatively using something like: http://ventral.org/pareview
Very Quick Manual Review:
You are missing dependencies for "date" and "feeds" in your .info file (documented requirements from your README.txt)
Comment #48
jurcello commentedI didn't know the coding standards where changed. I use codesniffer inspections in my editor.
I fixed all the errors mentioned above.
In respond to #47:
The date and feeds dependency only apply to the adlibfeeds module. The dependencies are listed in the info file of this module.
Question: what is holding the promotion of this module? I fixed all the security issues, but for some reason no one seems to promote this module. I am waiting for almost 2 years now.
Comment #49
sprocketman commentedjurcello, I think the main hold up is that you probably have not participated in pareview bonus mentioned in comment #22 and #32. Hope that helps.
Comment #49.0
sprocketman commentedx
Comment #49.1
jurcello commentedReview links added to get the PAReview: review bonus
Comment #50
jurcello commentedI now did some reviews. I hope that will help. Thanks for the comment!
Comment #51
gregglesThanks for doing the reviews. Please keep the security tag on the project for metric purposes.
Comment #52
jurcello commentedOkay, didn't know that. My mistake.
Comment #53
jurcello commentedI also updated the project page. Should be better now.
Comment #54
aendra commentedAutomated review:
Manual review:
dependencies[] = feeds_ui. If you don't want to make this a dependency, it might be worth noting in the README that this should also be enabled to follow the instructions. (Shouldn't block promotion)Leaving status for the moment: help me figure out why the other tokens aren't showing up and I'll change status to RTBC. :)
Comment #55
klausimanual review:
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.
Comment #56
jthorson commentedThanks for your contribution, jurcello!
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.
Comment #57
jurcello commentedThanx all for the reviews and promotion!
Comment #58.0
(not verified) commentedTypo