I’ve integrated the Gravatar third-party libraries with PHP Faker, and it's working as expected. Now, I’m trying to generate a fake user avatar using Gravatar, but I’ve encountered an issue.
Here's how I retrieve the avatar path from the temp directory (/tmp/e3395a721f569696dd6e9509dd20c8bb.jpg
), and it works fine:
$profile_icon_url = $this->faker()->gravatar(sys_get_temp_dir(), 'wavatar');
After that, I set the user’s avatar using the following method:
$user->saveIconFromLocalFile($profile_icon_url);
When trying to see the user profile the avatar is not displayed, and I have the following error in the log file
ELGG.ERROR: ErrorException: imagewebp(/var/data/elgg-6.x.x/5000/5667/profile/5667medium.webp): Failed to open stream: Permission denied in /home/pessek/WEB/elgg-6.0.0/vendor/imagine/imagine/src/Gd/Image.php:648\nStack trace
After investigation
The directory /var/data/elgg-6.x.x/5000/5667/profile/ does not contain a file named 5667medium.webp. It only contains a file named 5667master.jpg
So 5667medium.webp has not been generated.
Could someone help me ?
Regards,
can it be that the cli uses a different user than the webserver?
In your seeding (cli) only a master icon is created. Then on the website when you view a user the thumbnails are created which are needed. If the webserver can write the thumbnail (like it says in the error log) you won't see a thumbnail.
So check the permissions on the dataroot folder.
You may need to run 'Upgrade' via Dashboard to see the changes.
Thanks for the very fast response, I followed your instructions meticulously but I can't get the logo to display.
in the plugin you suggested there is a logo.png but it is stored at the following path
\elgg_theme\views\default\graphics\logo.png
I tried to follow your information by moving the file into the paths you indicated but nothing, I regularly updated at each test performed, but no results. Thanks again for your availability
The logo (as well sscover) is saved in /data/elgg_theme/ folder, where data is your Elgg data folder.
elgg_theme should be created when you upload the image.
Check that this folder exists on your server and it was created with the necessary permissions.
Thanks for your help. Everything works as hoped.
As for the "why": Let's just say that the way I'm an elggnoob, my users are general technoobs and the presence of the "add sub-page", "edit" and "add" buttons confused some of the users in such a way that we needed to find a solution to make it easier.
That said, I probably should take out the "friends" and "logged-in user" options from the "write access" drowndown menu in the "edit" page. Just in case. Let's see if I find out how to do that with what I've learned.
the "friends" and "logged-in user" options from the "write access" drowndown menu
The "Friends only" access level will persist in the menu. It's a bit more difficult to remove.
"Private" will be there by default and it will be fine for your users, IMO.
You should never insert data into the database manually, always use the Elgg APIs.
https://learn.elgg.org/en/stable/appendix/faqs.html#should-i-edit-the-database-manually
I see your script has a table '<prefix>users_entity' this table was dropped in Elgg 3.0, which ancient (unsupported) version of Elgg are you trying to use?
Hello, couple of points I would like to ask here
1. So the issue I think here is because I inserted data manually? What are the core Elgg API functions I need to use in my script?
2. I am using Elgg 6.1 version. The elgg_user_entity is the table which I have created. The elgg_entities and elgg_metadata tables have been already existing
3. Can you please guide me with issue? Should I use my existing python script to call for the correct API functions or can I build a custom PHP script for this to use css file to upload user data?
Is it possible to schedule a call here? I would highly appreciate if I can get some help here.
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by Raül Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.