Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
general-topic
Error on Uploading Custom Avatars and seemingly with "plupload" plugin
Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 8, 2015 - 7:52 am

To be honest if this were me I would ask my host support if they can see any reason why we would not be able to create the user folders needed. Probably get the quickest answer and, fingers crossed, maybe a solution..

andy-signature.png
YELLOW
SWORDFISH
Avatar
Ryan
Member
sp_UserOfflineSmall Offline
May 12, 2015 - 5:46 am

Hi,

My host would like to know what action triggers this bit of code to run as I and they can't see what makes that part run.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 12, 2015 - 6:10 am

Which bit of code? Surely the only bit that matters is the code that attempts to create the folder that is missing. Would that be the bit you want?

andy-signature.png
YELLOW
SWORDFISH
Avatar
Ryan
Member
sp_UserOfflineSmall Offline
May 13, 2015 - 2:57 pm

Yellow Swordfish said

Which bit of code? Surely the only bit that matters is the code that attempts to create the folder that is missing. Would that be the bit you want?

How do I recreate the scenario of simple-press trying to create a folder... like what is being done to make that folder? Is it avatar upload, an attachment... I can't work out what it is.

My host thinks the problem is within the Simple Press Upload plugin because it's trimming the directory incorrectly somehow.

[13-May-2015 12:01:09 Europe/London] PHP Warning - scandir(/problem-with-post-edit-buttonome/account1/public_html/wp-content/forum-image-uploads/mario3lia/): failed to open dir: No such file or directory - file: count1/public_html/wp-content/sp-resources/forum-plugins/plupload/ahah/sp-plupload-attachments-display.php - line: 28 - function: scandir

The folder is missing the first 2 letters of the hosting account name "account1" is named "count1"

EDIT: I found how to recreate it over and over (profile > attachments > click on the three directory trees)

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 13, 2015 - 3:23 pm

I covered this way back in the thread., It has nothing to do with the account name in the path. That is a red herring, The problem is in creating the final folder. Look at the actual text of the error:

scandir(/problem-with-post-edit-buttonome/account1/public_html/wp-content/forum-image-uploads/mario3lia/): failed to open dir: No such file or directory

There is nothing wrong with the path...

As to the question - what code is used to create the folder - then Simple:Press uses the core WordPress function wp_mkdir_p().

andy-signature.png
YELLOW
SWORDFISH
Avatar
Ryan
Member
sp_UserOfflineSmall Offline
May 14, 2015 - 4:02 am

Yellow Swordfish said
As to the question - what code is used to create the folder - then Simple:Press uses the core WordPress function wp_mkdir_p().

 So the error is happening when I go to Profile > Attachments > click on any of the directories...

To me it doesn't even look like it's trying to make a directory, it is just trying to scan... if the user hasn't uploaded anything surely $files will be blank or zero and should just say there are no files?

sp_forum_api_support();
$userid = sp_esc_int($_GET['uid']);
if (empty($userid)) die();
$thisUser = sp_get_user($userid);
global $plup;
sp_plupload_config($thisUser);

$sfconfig = sp_get_option('sfconfig');

$id = ($_POST['id'] == '#') ? '' : sp_esc_str($_POST['id']).'/';

$type = sp_esc_str($_POST['type']);

$path = $plup['basepath'][$type].$id;

$response = array();

$files = scandir($path);

It is only appearing for users who have not uploaded anything... if the user has uploaded the folder exists and then there are no errors...

My host said:

I've had a look at it and I'm not too sure on how to resolve the issue. The permissions seem fine, the php is up to date and the appropriate mods are enabled so I'm not sure what on the server would cause this.

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
May 14, 2015 - 6:59 am

I thought you were experiencing problems making an upload? I will talk to Mr Papa and we will have to look at that bit of coding... maybe need a little more rugged checking.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 14, 2015 - 9:08 pm

hmmm...  guess I too totally missed what you were trying to say - was thinking doing a file upload, not looking at previous uploads...  embarassed

its a lot more deeper than you are imagining... mainly because the tree stuff is a third party js library being used...   we dont output anything...

but if the there is no directory to scan, we should not throw the notice...  and will get that fixed up... a ticket is open...  and you are only seeing those in the error log, right?  that is not displaying errors on a production site...

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
May 14, 2015 - 9:33 pm

btw... there is already a message that says the use has no uploads...   just need to clean up the notices and have done so... will be in the next release of the plugin...

Avatar
Ryan
Member
sp_UserOfflineSmall Offline
May 15, 2015 - 12:46 pm

Yellow Swordfish said
I thought you were experiencing problems making an upload? I will talk to Mr Papa and we will have to look at that bit of coding... maybe need a little more rugged checking.

Yeah, that's what I thought it was but you guys told me that is not the case a few messages back, so I went and had a further look at the function and worked it out a little more.

That's the problem with me not knowing what all of your functions do, I just assumed it was to do with uploading avatars because it was the image upload folder where it was throwing notices. embarassed

Mr Papa said
hmmm...  guess I too totally missed what you were trying to say - was thinking doing a file upload, not looking at previous uploads...  embarassed

its a lot more deeper than you are imagining... mainly because the tree stuff is a third party js library being used...   we dont output anything...

but if the there is no directory to scan, we should not throw the notice...  and will get that fixed up... a ticket is open...  and you are only seeing those in the error log, right?  that is not displaying errors on a production site...

Yeah, like I just said to YS I had no idea what the notice was truly about because I didnt know what the attachment does, it took me lots of trial and error to find how to replicate the error.

At least it's not my fault and it can hopefully be fixed in the future update 🙂 I can relax now and ignore them errors for the mean time kiss

It's only showing in the error log, which I check all the time to make sure everything is working. Cough Wishlist Cough throwing thousands of errors lately 😛

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 617
Members: 17359
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10125
Posts: 79620