TC
Twill CMS•2y ago
antonypl

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 ?
No description
35 Replies
antonypl
antonyplOP•2y ago
could PHP version make this error ?
kallefrombosnia
kallefrombosnia•2y ago
Settings are planed to deprecate in the 3.x. Its much better to use normal singleton module anyway, since Settings are missing some features.
antonypl
antonyplOP•2y ago
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 ?
kallefrombosnia
kallefrombosnia•2y ago
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.
antonypl
antonyplOP•2y ago
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) ?
antonypl
antonyplOP•2y ago
I use docker, L10, Twill 3, PHP 8.1
No description
kallefrombosnia
kallefrombosnia•2y ago
Have you checked db, are values inserted?
antonypl
antonyplOP•2y ago
yes, they insert well
antonypl
antonyplOP•2y ago
No description
antonypl
antonyplOP•2y ago
id 3
kallefrombosnia
kallefrombosnia•2y ago
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.
antonypl
antonyplOP•2y ago
Ok, so i need build a custom Settings Models/Capsules. How unregister default settings routes ?
ifox
ifox•2y ago
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?
antonypl
antonyplOP•2y ago
@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
ifox
ifox•2y ago
thanks can you show me the db row in the twill_settings table? and those warnings in debug bar, which file/line produces them?
antonypl
antonyplOP•2y ago
No description
antonypl
antonyplOP•2y ago
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
ifox
ifox•2y ago
alright, db looks good. What does @dd($form_fields) output in your settings blade file?
antonypl
antonyplOP•2y ago
No description
No description
ifox
ifox•2y ago
interesting So the issue seems to be around having both translated and non translated fields
antonypl
antonyplOP•2y ago
I clear db (db:wipe, twill:install) and this is my result:
antonypl
antonyplOP•2y ago
before save
No description
antonypl
antonyplOP•2y ago
after save
No description
antonypl
antonyplOP•2y ago
db
No description
No description
ifox
ifox•2y ago
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?
antonypl
antonyplOP•2y ago
Does stack colud make a problem (Docker + Ubuntu 22 + PHP 8.1) ?
antonypl
antonyplOP•2y ago
Nope, no return value
No description
No description
No description
ifox
ifox•2y ago
no I don't think your stack is the issue
antonypl
antonyplOP•2y ago
after downgrade to Twill 2, settings legacy worsk fine
No description
No description
antonypl
antonyplOP•2y ago
@ifox.dev . How fix this issue on Twill3
ifox
ifox•2y ago
Hi @antonypl we will take a look asap
antonypl
antonyplOP•2y ago
@ifox.dev has been fixed ? @ifox.dev it still not working 😦
ifox
ifox•2y ago
Well, I'm sorry it hasn't been able to be prioritized yet. Pull requests are welcome, you know.
antonypl
antonyplOP•2y ago
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.
ifox
ifox•2y ago
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
Want results from more Discord servers?
Add your server