Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
30 Sep 2012 at 07:08 UTC
Updated:
18 Jan 2013 at 12:23 UTC
Jump to comment: Most recent file
Comments
Comment #1
weebpal commentedHi Daglees,
Please make your project follow coding standard first because it still has many error as attached script. And you also missed many t() function with the static text for example
Regards,
Steve Jan
Comment #2
dagleesHi Steve,
Thank you for the feedback. The issues have been fixed. Please see http://ventral.org/pareview/httpgitdrupalorgsandboxjdaglees1774752git for the latest report or rerun the test at http://ventral.org/node/71938/repeat
Comment #3
rob holmes commentedHi there i've highlighted a couple of things below.
parser.module
line 204: id='$count' you cant have a css id that begins with a number.
Might be nicer to use theme('image'.... on this line instead of the markup,actually you could use the FAPI for all of the _parser_image_print function.
parser.tpl.php
you have a hardcoded link to /sites/all/modules/parser/theme/prev.png this does not account for people who install in sites/all/modules/contrib or people using multisites etc.
parser.inc
Are there any drupal functions to perform the same task as DrupalcURLRequest?
Comment #4
dagleesImplemented theme() and fixed ID name.
No longer hardcoded.
Not that I know of.
Comment #5
dagleesComment #6
andrewkamm commentedAfter initially saving the configuration for a Link Parser field, I received some PHP warnings about code in parser.inc.
First warning:
strpos() [function.strpos]: Offset not contained in string in _parser_link_fetcher()for line 297 of parser.inc. The actual code of that line is:$url_base = drupal_substr($url, 0, strpos($url, "/", 8));.Second warning:
Warning: curl_setopt() [function.curl-setopt]: You must pass either an object or an array with the CURLOPT_HTTPHEADER, CURLOPT_QUOTE, CURLOPT_HTTP200ALIASES and CURLOPT_POSTQUOTE arguments in DrupalcURLRequest->get()"for line 72 of parser.inc. The actual code of that line is:curl_setopt($process, CURLOPT_HTTPHEADER, $this->headers);While checking that out I noticed that within DrupalcURLRequest, the class is missing a property declaration for $cookies.
When editing content with a parsed link, it would be great to get some visual feedback after clicking the "parse" button indicating the link has been parsed and maybe showing some parsed content.
After saving a node that has a parsed link (a Flickr search page) several warnings appeared, starting the same CURL warning above. I refreshed the page and receive just one,
Warning: array_flip() [function.array-flip]: Can only flip STRING and INTEGER values! in DrupalDefaultEntityController->load() (line 178 of […]/public_html/includes/entity.inc)..On the page itself, I see text from the link but no images. I checked the files directory and no images were added, though the file permissions appear to be fine.
Let me know if I can provide more info. Maybe there's a dependency I'm missing. I'm using a mostly vanilla Drupal 7 install ("standard" profile).
An aside, you've already got the major version branch (7.x-1.x) as default, but consider removing the "master" branch entirely via the process documented here.
Comment #7
cubeinspire commentedHi !
Nice module but ... :-)
Major bugs:
1. After install I add the parser field to a content type and inside the default value I enter an url.
When I click on parse i got the an Ajax error:
2. When I try to save the new field, I'm redirected to a white screen. The field doesn't saves.
3. As far as I know modules add stylesheets and js files using drupal_add_css and drupal_add_js, you are adding them inside the .info file as if it was a theme.
Minor bugs:
4. Line 149. Images should be added with theme('image', array());
5. You are using document.ready(function()), you should use this instead:
Comment #8
cubeinspire commentedchanging status
Comment #9
dagleesThanks for the feedback. I'll be doing more work on Parser today and update this issue.
Comment #10
dagleesUpdated the codebase with many improvements. Now working on better demonstration such as when the Parse link is clicked and improving the quality of the JS code.
Comment #11
daglees#6 -- the warnings should be gone now; I'm doing stricter checking.
Visual feedback is available but it's still kind of slow. I'm working on improving that.
Images are handled by their own function now.
I've removed the master branch.
Comment #12
daglees#7
Fixed major bugs. The stylesheet and javascript files can be added through the .info file so they're available in all pages and registered by the Drupal cache.
Can you link me to the documentation page explaining the Drupal.behaviors usage?
Comment #13
cubeinspire commentedHi,
I don't have any documentation in hand for you... I've learned this when I passed the review process as you now. I've googled and found this link: http://drupal.org/node/756722#jquery-once
It can be of some use. I'm sure that a deeper Google search will give better information.
Change the status to needs review and I check it. Hope this can be released ASAP.
If you want to speed up the process you can help by reviewing other projects and earn a review bonus.
Regards,
Sergio
Comment #14
dagleesPushed some more adjustments.
Comment #15
cubeinspire commentedHi,
First the error I reported is still there:
I still have this problem when I try to parse the default value of the field.
I cannot save the field neither, the ajax call to /system/ajax returns a 500 error.
I supossed that this could be because I was working on localhost, so I installed the module on a real online installation and I've got this error:
I would strongly suggest you to use the simplehtmldom library, that library is already adapted to Drupal by the module simplehtmldom, just mare a dependency and use their API... I use it myself on a new module I'm building and works perfect and easy !
By doing that you will avoid lots of problems and will have also tools to improve your module after.
Another thing at line 182 of parser.module you should use theme_image() and l() functions.
You can put an image inside a link by setting the parameter html equal true.
Comment #16
dagleesVery nice suggestion on using PHP Simple HTML DOM Parser. I'll look into that.
I think the error you're getting is because Drupal is running in a subdirectory. I'll try to replicate that and fix it.
Comment #17
cubeinspire commentedHi Daglees.
My local installation is in a subdirectory, but the online installation is on the root (from a DNS point of view).
Both are having problems. Hope that can help you.
Comment #18
roynilanjan commentedFew comments,
because what I follow module_load_include is used several times in module as far requirement. so helps you to optimize the extra piece of code from module
so should I use a constructor instead of this method? what do you think?
Instead of writing two different methods for get & post there should be a single method from where request
method($_SERVER['REQUEST_METHOD']) will be determined & according to condition rest of curl method will be processed.
Comment #19
cubeinspire commentedHow is this going ? I need it for a project ;-)
Comment #20
dagleesI'm working on this on my free time. The agency I work for has changed their requirements so this isn't what they want anymore, otherwise I'd be updating it more often.
The main area I'm working on now is improving the parser's performance.
Comment #21
cubeinspire commentedIf you want we can work together on this module as I need it for a project and I was going to replace parts of your code to integrate it with simpleHtmlDom library.
Comment #22
cubeinspire commentedMore Issues:
1. There is a problem with the validation function: (parser.module line 113)
If the element is not required, why the value cannot be empty ? This is a mistake from my point of view.
2. On the parser.tpl.php the link to the page should be clickable not only a text label.
After all this is a Link field (with parsed content as extra value).
line 15:
<label id="atc_url"><?php print l($item['link'], $item['link']); ?></label>3. The #ajax callback is not working. I've opened a detailed issue for this problem, with the solutions I've found. You can find it here: http://drupal.org/node/1824234
4. I think it could be good also to modify the name of the project from "Parser" to "Parser field", as parser is too generic and can be in conflict with other modules.
Comment #23
dagleesHi logicdesign,
I could work better on some of these notes if you'd open issues on the project's issue queue. Contact me about working on this project together so we can be on the same page.
Thanks!
Comment #24
cubeinspire commented@Daglees: I edited last comment and created an issue with the details of .3
Comment #25
cubeinspire commentedI've just commited a new version but had not enough time to check everything :-)
Modifications:
- Using simplehtmldom parser (dependency).
- Modifications to allow multiple fields.
- Parsing preview on the edit form should work normally now.
Remaining issues:
- Still some css / js to adapt.
- Check security code.
- Check code standards.
Comment #26
daglees@logicdesign Are you sure you've committed it to the Parser repo? I don't see any changes.
Comment #27
cubeinspire commentedYes something strange happend with the git ! You can check now.
I created a 7.x-2.x to host the version with the simplehtmldom dependency and the other modifications.
There is still work to do on it...
- security check up and code standard cleaning.
- We could also some "intelligent parsing" for body content, title & images
( as you did for images in version 7.x-1.x).
- The user manual input should override the parsed values on _parser_link_validate().
That would allow the user to change the body content if he's not happy with the parsed one.
Comment #28
klausiClosing due to lack of activity. Feel free to reopen if you are still working on this application.
If you reopen this please keep in mind that we 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 #28.0
klausiBetter formatting