-
Notifications
You must be signed in to change notification settings - Fork 683
Open
Labels
Description
What happened?
The documentation for EVENT_AFTER_SAVE_USER_PHOTO is incorrect, on the Events Generator page. Not sure whether this is because the constant's docblock is also wrong.
Ditto for EVENT_BEFORE_SAVE_USER_PHOTO.
Here is what the docs say...
The docblock in Craft's source code says the same thing...
Line 173 in 0a86c21
| * @event UserSavePhotoEvent The event that is triggered before a user photo is saved. |
The problem is, services\UserSavePhotoEvent is not a real event. It should say events\UserPhotoEvent instead.
Here is what it should actually say...
use yii\base\Event;
use craft\services\Users;
use craft\events\UserPhotoEvent; // <-- CORRECT EVENT
Event::on(
Users::class,
Users::EVENT_AFTER_SAVE_USER_PHOTO,
function (UserPhotoEvent $event) {
// ...
}
);Steps to reproduce
- Attempt to use the
EVENT_AFTER_SAVE_USER_PHOTOevent as demonstrated in the docs.
Expected behavior
Should work as intended.
Actual behavior
services\UserSavePhotoEvent doesn't actually exist.
Craft CMS version
5.8.17
PHP version
n/a
Operating system and version
n/a
Database type and version
n/a
Image driver and version
n/a
Installed plugins and versions
n/a