Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This module adds a way to upload files using http://uploadcare.com/
Module adds a field to be added to the structure. You can select if it is a file or an image. For image your can select file operations to be done, like resizing, cropping, applying different effects. An image or a file will be available through CDN.
You can get your own account at https://uploadcare.com/accounts/create/
There's a nice free plan.
git: git.drupal.org:sandbox/grayhound/1905848.git
git clone --recursive http://git.drupal.org/sandbox/grayhound/1905848.git uploadcare
Tested on Drupal 7.x
Comments
Comment #1
monymirzaSome Drupal standards missing. see here:
http://ventral.org/pareview/httpgitdrupalorgsandboxgrayhound1905848git
Comment #2
grayhound CreditAttribution: grayhound commentedI've made some changes, most of errors are gone.
Errors inside "uploadcare-php/lib/*" cannot be fixed just because it's an external library. It's not only the Drupal Module uses it.
By the way, I've checked code with "Coder" Module, and no critical errors found.
Comment #3
grayhound CreditAttribution: grayhound commentedComment #4
monymirzaBy using external library in drupal module, try to use it with libraries module.
there are two "read me" files. remove README.md
Still Drupal standards missing. see here:
http://ventral.org/pareview/httpgitdrupalorgsandboxgrayhound1905848git
Comment #5
monymirzaComment #6
strakkie CreditAttribution: strakkie commentedA few points concerning your module:
When installing i get the following error:
Warning: require_once(C:\xampp\htdocs\review/modules/uploadcare/uploadcare.field.inc) [function.require-once]: failed to open stream: No such file or directory in require_once() (line 8 of C:\xampp\htdocs\review\sites\all\modules\review\uploadcare\uploadcare.module).
This is because you use:
have a look at drupal_get_path at: http://api.drupal.org/api/drupal/includes!common.inc/function/drupal_get...
You should then use this:
About your commenting:
Since you are using hook_menu() comments should read Implements hook_menu(), you are using this right in uploadcare.field.inc.
Also, have a look at the coder module: http://drupal.org/project/coder
This module reviews your code and gives you an idea about problems that may exist.
Using the coder module it gives me 2 potential problems in uploadcare.field.inc.
And
Like the error above shows, have a look at the check_plain function.
In line 185 of uploadcare.field.inc. you call function uploadcare_field_widget_form_postfix with the @ to hide errors. If well coded this should not be necessary, could you explain why you use this?
Besides your comments about functions you do not use any inline comments, these are a great way to comment code blocks inside a function, try to use these because they can save you and other programmers a great deal of time figuring out what the piece of code in a function does.
Comment #7
grayhound CreditAttribution: grayhound commentedI'm sorry, I don't understand meaning of this phrase at all, it's meaningless.
I've fixes most of problems inside module itself. Everything inside "uploadcare-php/lib/*" is an external module. I can't rename method, parameters of a class, etc just because about 10 plugins/modules/extension depend on this library. We have our own standarts and this lib is not just for Drupal. So please stop bothering with this resource if nothing serious.
Thanks, fixed with your suggestion.
Applied check_plain for the title and description.
Added some inline comments but the code itself is really plain and simple.
Comment #8
vladimir-m CreditAttribution: vladimir-m commentedHello grayhound ,
Thank you for great module.
I have detected some issues.
1. Then I Enable this module I get "HTTP Error 500 (Internal Server Error)".
PHP Fatal error: require_once(): Failed opening required '/var/www/drupal-7.18/modules/uploadcare/uploadcare.field.inc' (include_path='.:/usr/share/php:/usr/share/pear') in /var/www/drupal-7.18/sites/all/modules/uploadcare/uploadcare.module on line 8, referer: http://drupal7.loc/radmin/modules
2. In install file remove
uploadcare_public_key
anduploadcare_secret_key
variables http://api.drupal.org/api/drupal/includes%21bootstrap.inc/function/variable_del/73. Regarding 3rd party libraries http://drupal.org/node/422996
Comment #9
grayhound CreditAttribution: grayhound commentedFixed the error. Used a drupal-way to include files for modules.
Made an uninstall hook
Deleted the uploadcare-php library from drupal's git repo and added an information about installing module and 3-rd party library in the readme.txt
Comment #10
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 #11
DebtConsolidationCare CreditAttribution: DebtConsolidationCare commentedHere goes the review for 'uploadcare' 7.x-1.x branch:-
1. Online review report for drupal codeing standard is http://ventral.org/pareview/httpgitdrupalorgsandboxgrayhound1905848git-7...
2. In your project application, link to the corresponding project page is missing.
3. In the project page, default branch is not set as 7.x-1.x
4. On installing the module it gives a fatal error as :-
Fatal error: require_once() [function.require]: Failed opening required '/home/debtcc/docroot/drupal720/modules/uploadcare/uploadcare.field.inc' (include_path='.:/usr/share/pear:/usr/share/php') in /home/debtcc/docroot/drupal720/sites/all/modules/under_review/uploadcare/uploadcare.module on line 8
Comment #12
grayhound CreditAttribution: grayhound commentedSorry, was in a hurry, forgot to merge from master to 7.x-1.x
Changed the version to 7.x-1.x, url now leads to github.
All errors must go away.
Comment #13
mikespence CreditAttribution: mikespence commentedFew things:
Comment #14
samearle CreditAttribution: samearle commentedbroken
Comment #15
chris.smith CreditAttribution: chris.smith commentedWhen trying to enable the plugin I received the following errors:
Attempted to enable the plugin again and received a different error:
Comment #16
grayhound CreditAttribution: grayhound commentedI can't cut long urls and etc. I suppose README file is not a big problem...
Can you help with it? I can't find any infomation about.
Ok, i did that... but what for?
Please, everyone, read the readme info!
If you use the drupal's github you must install additional external library! It's removed now from module.
You must install like this:
### Drupal git
Comment #17
mpv CreditAttribution: mpv commentedAutomatic review
There are still some errors reported by PAReview: http://ventral.org/pareview/httpgitdrupalorgsandboxgrayhound1905848git-7.... Most of them are long lines warnings. As you said it's not always possible to fix this, but some can be fixed. There are also two errors (according to drupal coding standards).
Now that you added the 7.x-1.x branch you should change the default branch in your project and remove the master branch.
Manual review
I think the module settings page should be under Configuration > Media, and not at the top level of the menu. You can achieve this by changing the path to
admin/config/media/uploadcare
inuploadcare_menu
. Maybe also add a description there.This is more of a question, but if I set a field as unlimited, when I click on the Add another item button a textfield becomes visible. I don't know if this is desired behaviour or not.
Other than this minor fixes I think this is a good module and should be RTBC.
Comment #18
grayhound CreditAttribution: grayhound commentedDefault branch is 7.x-1.x
Only 3 line warnings left - just can't be fixed due to long urls and git commands
"Uploadcare setting" are under "Configureation > Media" now.
Fixed visible textfields - always hidden now.
New Uploadcare widget version 0.8+
Comment #19
mpv CreditAttribution: mpv commentedI think this is RTBC, so I'm changing status, but I will suggest an improvement (although it's not blocking the project application). I think you should consider using Libraries API to load the uploadcare-php library. This way the library can sit in sites/all/libraries, and can be used by other modules, control which version is used, etc. It's a simple change that I think will improve your module.
Comment #20
kscheirermodules/uploadcare
should that besites/all/modules/uploadcare
? To go along with that, the Libraries API module is a recommended method for adding 3rd party dependencies with using hard-coded paths in your module.'access arguments' => array('administer uploadcare'),
but I don't see a hook_permission() anywhere.----
Top Shelf Modules - Enterprise modules from the community for the community.
Comment #21
PA robot CreditAttribution: PA robot commentedClosing due to lack of activity. Feel free to reopen if you are still working on this application (see also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.