Hello, I am porting this module to Drupal 7. You can find the sandbox project here. Please review the code and if you find any bugs then tell me about the same.

CommentFileSizeAuthor
#6 error_log.txt8.35 KBeugene.ilyin

Comments

eugene.ilyin’s picture

Hello.
Excellent. I will look at the project for a couple days and let you know here. Thank you.

eugene.ilyin’s picture

What version of the module you are ported to drupal 7?

subhojit777’s picture

Its the latest stable release of your module i.e. 6.x-2.1. I have also provided this information in the "version" while creating this issue.

eugene.ilyin’s picture

Hello, sorry for the delay but I have no time. I checked your module on Drupal 7, and it causes an error, and JavaScript is not working because of this. Try to update the js library ajax_picture_upload.
I tested your module in browser Google chrome 16 for Linux.

subhojit777’s picture

Could you please post the error in the issue. In the meantime I will check the ajaxfileupload.js file.

eugene.ilyin’s picture

StatusFileSize
new8.35 KB

Of course, that's the error log.

subhojit777’s picture

Hello, Eugene I have fixed the error. Please review the code once again, and tell me if there are any missing functionality. Since I am using Drupal 7, there is image preview built in the core, so I am not getting the difference if I enable he module and upload any image. Please recheck the ported module.

Have a nice day :)

P.S. If you have built any other modules in Drupal 6 give me their project links I will port them to Drupal 7

eugene.ilyin’s picture

Hello I checked your module on an empty installation of drupal 7 without options and modules, and I got this error. I will be able to review your work in the evening.

eugene.ilyin’s picture

I still see the error. You forgot to add code to the repository?

subhojit777’s picture

Yup, you are right. Sorry. I will push the changes to repository.

subhojit777’s picture

Status: Active » Needs review
eugene.ilyin’s picture

Sorry but I'm too busy. I'll try to look tonight.

eugene.ilyin’s picture

I have JS error when I try to upload avatar
"Uncaught TypeError: Object function (j,s){return new b.fn.init(j,s)} has no method 'ajaxFileUpload'"
ajax_pic_preview.js:17

Browser: Google Chrome 16 for Ubuntu

eugene.ilyin’s picture

Status: Needs review » Needs work
eugene.ilyin’s picture

Hello. Will you continue to work further?

subhojit777’s picture

sure sure :) i am sorry for not replying. was busy...

subhojit777’s picture

I can't find the error when I upload image in Drupal 7 website and this ported module is also enabled in my Drupal 7 installation. I am uploading and adding an image to a node but dont get the error. How are you uploading the image?

eugene.ilyin’s picture

Hello I am extremely busy in recent days. I will write to you as soon as I can find the time. Sorry.

subhojit777’s picture

Its ok. I always forget to tell the version of my browser, its Chromium Web Browser version 17.0.963.65

There are some errors coming while I enable the module, I haven't noticed this before. Please give me some time to fix those errors.

subhojit777’s picture

The errors are removed and you can test the module and check its functionality.

I have changed the .install file of this module, the pictures/tmp directory gets removed on uninstallation.

eugene.ilyin’s picture

Hello. Sorry for delay.

I try to upload photo and see:

Uncaught TypeError: Object function (j,s){return new b.fn.init(j,s)} has no method 'ajaxFileUpload' ajax_pic_preview.js:17
ajaxFileUpload ajax_pic_preview.js:17
c.event.handle jquery.js:64
c.event.add.h.handle.o jquery.js:57

I use Chrome on Ubuntu v.16.0.9

subhojit777’s picture

Ok, I will fix this bug

subhojit777’s picture

In your module you are using hook_cron, there you are calling file_delete(). In Drupal 6 file_delete takes filepath as parameter, but in Drupal 7 it takes file object as parameter. Seeing the code in hook_cron I didn't found any way to get file object from its filepath, I also searched the file API but there are no such functions. So, I am using PHP's unlink() function to obtain the same functionality in Drupal 7.

eugene.ilyin’s picture

In version 6.x-3.x I refused of hook cron. It is better if you took this version as a basis.

eugene.ilyin’s picture

Status: Needs work » Closed (won't fix)