Clean custom table column from admin panel
Forum rules
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
Always add your Laravel, Aimeos and PHP version as well as your environment (Linux/Mac/Win)
Spam and unrelated posts will be removed immediately!
-
- Posts: 27
- Joined: 04 Jun 2020, 14:00
Clean custom table column from admin panel
Hi, Aimeos. One more question.
Laravel 6. Aimeos 2020.10
I have extended the manager customer address through the easy way, add custom fields in admin panel, and all works fine except cleaning fields, it doesn`t delete content and keep previous. Please, advise, what I am doing wrong.
Сolumn (I tried with default => '' and just with length also)
Decorator fields (methods the same from instruction):
Admin panel field (also with item key ahed):
In debugger I see that housing has null during saving, but seems, it not saving by managers.
Thank you.
P.S. IMHO It is not obvious in docs that we need to create table columns exactly by php artisan aimeos:setup command, and will better to place it in documentation also in easy way chapter.
Laravel 6. Aimeos 2020.10
I have extended the manager customer address through the easy way, add custom fields in admin panel, and all works fine except cleaning fields, it doesn`t delete content and keep previous. Please, advise, what I am doing wrong.
Сolumn (I tried with default => '' and just with length also)
Code: Select all
$table->addColumn( 'housing', 'string', array( 'length' => 200, 'notnull' => false ) );
Code: Select all
'housing' => [
'code' => 'housing',
'internalcode' => 'lvuad."housing"',
'label' => 'Address housing',
'type' => 'string',
'internaltype' => \Aimeos\MW\DB\Statement\Base::PARAM_STR,
]
Code: Select all
<div class="form-group row optional">
<label class="col-sm-4 form-control-label help"><?= $enc->html( $this->translate( 'admin', 'Housing' ) ); ?></label>
<div class="col-sm-8">
<input class="form-control item-housing" type="text" tabindex="<?= $this->get( 'tabindex' ); ?>"
v-bind:name="'<?= $enc->attr( $this->formparam( array( 'address', 'idx', 'housing' ) ) ); ?>'.replace('idx', idx)"
placeholder="<?= $enc->attr( $this->translate( 'admin', 'Housing' ) ); ?>"
v-bind:readonly="checkSite('customer.address.siteid', idx)"
v-model="items[idx]['housing']" />
</div>
<div class="col-sm-12 form-text text-muted help-text">
<?= $enc->html( $this->translate( 'admin', 'Address housing' ) ); ?>
</div>
</div>
Thank you.
P.S. IMHO It is not obvious in docs that we need to create table columns exactly by php artisan aimeos:setup command, and will better to place it in documentation also in easy way chapter.
Re: Clean custom table column from admin panel
First of all, Aimeos already has an address field for storing additional address data (customer.address.address3). In fact, there are three generic address fields (address1, address2, address3) which you can use like you need them. They are not tied to any fixed schema because depending on the regions your customers are living in, the address format may be totally different. There's only a standard naming in Aimeos but you can change translations as you need.mr.zherart wrote: ↑13 Apr 2021, 17:48 I have extended the manager customer address through the easy way, add custom fields in admin panel, and all works fine except cleaning fields, it doesn`t delete content and keep previous. Please, advise, what I am doing wrong.
Сolumn (I tried with default => '' and just with length also)Code: Select all
$table->addColumn( 'housing', 'string', array( 'length' => 200, 'notnull' => false ) );
Which Aimeos version do you use?mr.zherart wrote: ↑13 Apr 2021, 17:48 In debugger I see that housing has null during saving, but seems, it not saving by managers.
Can you check what happens here:
- https://github.com/aimeos/aimeos-core/b ... #L388-L394
- https://github.com/aimeos/aimeos-core/b ... #L230-L242
Ok, we will care about that.mr.zherart wrote: ↑13 Apr 2021, 17:48 P.S. IMHO It is not obvious in docs that we need to create table columns exactly by php artisan aimeos:setup command, and will better to place it in documentation also in easy way chapter.
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 27
- Joined: 04 Jun 2020, 14:00
Re: Clean custom table column from admin panel
Hi, I`m sorry for the very late answer, only now I can and need to come back to debugging this.
The bug is still there. I see from the debugger that the value goes to fromArray as null, and is_scalar does not pass it.
I used Aimeos 2020.10, now is 2021.04.Which Aimeos version do you use?
Can you check what happens here:
- https://github.com/aimeos/aimeos-core/b ... #L388-L394
- https://github.com/aimeos/aimeos-core/b ... #L230-L242
The bug is still there. I see from the debugger that the value goes to fromArray as null, and is_scalar does not pass it.
Re: Clean custom table column from admin panel
The problem should have been fixed with this commit:mr.zherart wrote: ↑03 Jun 2021, 12:46 The bug is still there. I see from the debugger that the value goes to fromArray as null, and is_scalar does not pass it.
https://github.com/aimeos/aimeos-core/c ... 9f51d970d1
It's available in aimeos/aimeos-core 2020.10.25 and 2021.04.7. Can you confirm that using these versions fixes the problem?
Professional support and custom implementation are available at Aimeos.com
If you like Aimeos, give us a star
If you like Aimeos, give us a star
-
- Posts: 27
- Joined: 04 Jun 2020, 14:00
Re: Clean custom table column from admin panel
Sorry for the late feedback, the problem has been fixed. Thank you.