User Profile Settings / Profile Picture Change
Pluggin away and am currently trying to fix functionality in the User Drop Down.
When I click "settings" Error Call to undefined function profile_field() "{!! profile_field('text_area', 'about') !!}"
I see wave.php has 'profile_fields' => [ 'about' ],
what connections are not being made correctly? deleting {!! profile_field('text_area', 'about') !!} from profile.blade allows settigns page to be viewed but obv about is not fucntional.
globals has issue with autoloader C:\Projects\D486WEBSITE> composer dump-autoload Generating optimized autoload files Class Wave\Helpers\WaveKeyValueConvertible located in ./wave/src/Helpers/globals.php does not comply with psr-4 autoloading standard (rule: Wave\ => ./wave/src). Skipping. Class Wave\Helpers\WaveKeyValueHelper located in ./wave/src/Helpers/globals.php does not comply with psr-4 autoloading standard (rule: Wave\ => ./wave/src). Skipping. Class Wave\Helpers\WaveKeyValueTypeHelper located in ./wave/src/Helpers/globals.php does not comply with psr-4 autoloading standard (rule: Wave\ => ./wave/src). Skipping.
GPT is telling me: Your User model extends from Wave\User, which indicates that it inherits functionality from the Wave package's User model. However, the profile() method, which the profile_field() function relies on, is not defined in this User model.
Hi 👋
Which version of wave are you using? And what is the PHP version that you are using?
That function is defined here and already exists:
Did you make any changes to that view which could have caused the problem?
- Bobby
Hi there,
And what is your composer version as well? I've not been able to reproduce this locally so maybe it is somehow related to your Windows environment.
What you could try is to just match the psr-4 standard as shown in the error that you are getting, eg move the there wave related globals in separate files as follows:
-
Wave\Helpers\WaveKeyValueConvertible
should be inwave/src/Helpers/WaveKeyValueConvertible.php
. -
Wave\Helpers\WaveKeyValueHelper
should be inwave/src/Helpers/WaveKeyValueHelper.php
. -
Wave\Helpers\WaveKeyValueTypeHelper
should be inwave/src/Helpers/WaveKeyValueTypeHelper.php
.
After that run composer dump-autoload
and then give it another try.
Let me know how it goes.
The problem was, I must have added "namespace Wave\Helpers;" at the top of the globals.php. The online repo version did not have this. I don't remember how it got there, but after replacing the globals.php with the online repo version. The settings page loads correctly now.
However I'm still getting autoload warnings. Should I split them into the individual files as suggested or leave as is? I imagine the globals should work as is since that's how you wrote it. So am I missing something for it to work?
Composer VS = 2.7.7
PS C:\Projects\D486WEBSITE> composer dump-autoload Generating optimized autoload files Class WaveKeyValueConvertible located in ./wave/src/Helpers/globals.php does not comply with psr-4 autoloading standard (rule: Wave\ => ./wave/src). Skipping. Class WaveKeyValueHelper located in ./wave/src/Helpers/globals.php does not comply with psr-4 autoloading standard (rule: Wave\ => ./wave/src). Skipping. Class WaveKeyValueTypeHelper located in ./wave/src/Helpers/globals.php does not comply with psr-4 autoloading standard (rule: Wave\ => ./wave/src). Skipping.
Hi,
Ah yes it makes sense that adding the namespace would cause the problem!
For the warnings, the answer that I shared above should be enough to fix them. Did you try it out?