Fix no user name shown just after upload file#18
Fix no user name shown just after upload file#18laoneo merged 8 commits intoDigital-Peak:developmentfrom
Conversation
…s input fields where present in screen, since loops where nested
Fix multiple event listeners
… calling 'Factory' to get user data
|
Thanks! |
* 'Drag&Drop' events where binded to each 'upload form' as many times as input fields where present in screen, since loops where nested * Whitespaces changes fixed * Fixed no user name shown just after file uploaded (Id showed) * Fixed no user name shown just after file uploaded (Id showed) * Using 'UserFactoryAwareInterface' and 'UserFactoryAwareTrait' instead calling 'Factory' to get user data
|
Just to let you know that I renamed your changes and merged them into main. Probably you have to delete the development branch and recreate it again to pick up the changes. |
|
Thanks for the code style fixes, I really appreciate them. Be careful with lines 48, 49 and 50 in com_dpattachments/admin/src/Controller/AttachmentController.php: $item->author_id = $author['author_id']; Creation of dynamic property is deprecated in Joomla 5 and will be removed in Jooma 6. |
Where do you have that information from? Dynamic properties are allowed on \stdClass where CMSObject is inheriting from since Joomla 5.1. |
Sorry, you are right |
When uploading a file, if no "created_by_alias" is set, user id is shown instead user name.
This is because after uploading file, "getItem" method is called, and just info about item (file) is loaded, and this only includes user id, not user name nor email.
If reloading/refresing page, it works ok because "getItems" method is called, which "joins" user id with user table and retrieves user name and email.
Solution is, after uploading file and loading item data and before rendering, calling a new method to load user information (name and email), using "$item->created_by" identifier from item object.