Error when adding address field in publicRegistration



I'm stuck on this error, I tried fixing this error.

$row = $form->addRow();
$row->addAlert(__('Address information for an individual only needs to be set under the following conditions:'), 'warning')
->append('')
->append(''.__('If the user is not in a family.').'')
->append(''.__('If the user\'s family does not have a home address set.').'')
->append(''.__('If the user needs an address in addition to their family\'s home address.').'')
->append('');

$row = $form->addRow()->addClass('address');
$row->addLabel('address1', __('Address 1'))->description(__('Unit, Building, Street'));
$row->addTextField('address1')->maxLength(255)->required();

$row = $form->addRow()->addClass('address');
$row->addLabel('address1District', __('Address 1 District'))->description(__('County, State, District'));
$row->addTextFieldDistrict('address1District')->required();

$row = $form->addRow()->addClass('address');
$row->addLabel('address1Country', __('Address 1 Country'));
$row->addSelectCountry('address1Country')->required();


I copied this code from user_manage_add.php

can someone please guide me?

Comments

  • Adding the following line at the top should fix this:

    use Gibbon\Forms\DatabaseFormFactory;

    ;)
    admin
  • Thanx for the help!

    When I added it it didn't work at first.
    After I added this it worked for me. (line 63 & 64)


    I hope it helps someone.

    Again thnx @meierrom !
    adminmeierrom
Sign In or Register to comment.