Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Can't get a way to read the property "phone_number" in class "...." #93

Closed
Mecanik opened this issue Nov 6, 2021 · 2 comments · Fixed by #94
Closed

"Can't get a way to read the property "phone_number" in class "...." #93

Mecanik opened this issue Nov 6, 2021 · 2 comments · Fixed by #94

Comments

@Mecanik
Copy link

Mecanik commented Nov 6, 2021

Hi,

I followed the documentation, ensured property is inside the table, cleared cache; still the error persists.

CRITICAL06:13:38 request Uncaught PHP Exception Symfony\Component\PropertyAccess\Exception\NoSuchPropertyException: "Can't get a way to read the property "phone_number" in class "...."." at ....\vendor\symfony\property-access\PropertyAccessor.php line 496{ "exception": {} }

I do not understand, what is the issue? I`m using Symfony 5.3.10.

@Mecanik
Copy link
Author

Mecanik commented Nov 6, 2021

I found the issue, your documentation is flawed. Please update the documentation to reflect the correct entity field name you specified:

use libphonenumber\PhoneNumberFormat;
use Misd\PhoneNumberBundle\Form\Type\PhoneNumberType;
use Symfony\Component\Form\FormBuilderInterface;

public function buildForm(FormBuilderInterface $builder, array $options)
{
    $builder->add('phoneNumber', PhoneNumberType::class, array('default_region' => 'GB', 'format' => PhoneNumberFormat::NATIONAL));
}

@maxhelias
Copy link
Collaborator

Hi,
This is an open source project, you are also allowed to correct the documentation.
And we would be happy to merge it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants