Legacy Settings Sections return values doesn't work
Hi,
After save Settings to database, values doesn't bind in inputs.
How fixed this @ifox.dev ?
35 Replies
could PHP version make this error ?
Settings are planed to deprecate in the 3.x. Its much better to use normal singleton module anyway, since Settings are missing some features.
so, Settings default Area doesn't work as in 2.x (return saved fields) and you suggest to prepare custom module name this same as default Settings ?
Its the easiest solution to have singleton named Settings. Default Settings are not fully supporting all of the normal module features. I faced this recently, had issues with the media field only supporting one max media.
Mhm, so Dock suggest a mistake, if i use Legacy. BTW, why Legacy doesn't return any values from database, typical input field (no media) ?
I use docker, L10, Twill 3, PHP 8.1
Have you checked db, are values inserted?
yes, they insert well
id 3
It seems that https://github.com/area17/twill/blob/2.x/src/Repositories/SettingRepository.php#L52C3-L84 fail to get form fields.
But still, I wouldnt waste a time on this.
Ok, so i need build a custom Settings Models/Capsules. How unregister default settings routes ?
hi guys, legacy Twill 2 settings should still work perfectly fine, especially on Twill 2 where they haven't been touched. They are just more limited in their capabilities, but should save and render fine.
ok I see you're on Twill 3 though. So if there's a regression on legacy settings we would still want to fix it
Could you please share your settings blade file?
@extends('twill::layouts.settings')
@section('contentFields')
@formField('input', [
'translated' => true,
'name' => 'subtitle_translated',
'label' => 'Subtitle (translated)',
'maxlength' => 250,
'required' => true,
'note' => 'Hint message goes here',
'placeholder' => 'Placeholder goes here',
'type' => 'textarea',
'rows' => 3
])
@stop
thanks
can you show me the db row in the twill_settings table?
and those warnings in debug bar, which file/line produces them?
LOG.warning: substr_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /var/www/html/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php on line 575
WARNINGLOG
[09:09:53]
LOG.warning: strlen(): Passing null to parameter #1 ($string) of type string is deprecated in /var/www/html/vendor/laravel/framework/src/Illuminate/View/Compilers/BladeCompiler.php on line 576
alright, db looks good. What does
@dd($form_fields)
output in your settings blade file?interesting
So the issue seems to be around having both translated and non translated fields
I clear db (db:wipe, twill:install) and this is my result:
before save
after save
db
twill:install isn't really something you should be running more than once, but that's fine. can you try with only non translated and only translated fields?
Does stack colud make a problem (Docker + Ubuntu 22 + PHP 8.1)
?
Nope, no return value
no I don't think your stack is the issue
after downgrade to Twill 2, settings legacy worsk fine
@ifox.dev . How fix this issue on Twill3
Hi @antonypl we will take a look asap
@ifox.dev has been fixed ?
@ifox.dev it still not working 😦
Well, I'm sorry it hasn't been able to be prioritized yet. Pull requests are welcome, you know.
So your answer "we will take look asap" (months later) sounds bad. This is crtical bugs, if used older version. Response from team should be a litte diffrent.
This project is open source and entirely free, as well as our support @antonypl, so I'm not sure what makes you feel entitled to criticize that. We don't owe you anything, and you are using a feature that will be deprecated. We also provided solutions for you that you ignore. I didn't give any details as to when asap would be, and honestly if you're upset after a month, I suggest you revise your expectations when working with open source software.
Instead of complaining to people that are giving you a lot of work for free, try to migrate to the new settings feature, it will take you less time than sharing your frustrations with us