orchidsoftware / orchidsoftware/platform
Unexpted changing of public properties in class Screen
Open
@tabuna is already working on this.
Since Dec 25, 2023.
Errors
- Dominant language
- PHP
- Stars
- 4.8k
- Forks
- 662
- Avg merge
- 1d 9h
- Merged PRs (30d)
- 7
Description
it seems that value of ALL public properties of Screen is changed after query() call.
Even if this property is not changed in query()
Compare values in query() and Save
class MyScreen extends Screen
{
protected $protected_property = 'Some protected value';
public $public_property = 'Some public value';
public function query($id = null): iterable
{
echo $this->protected_property; // 'Some protected value'
echo $this->public_property; // 'Some public value'
return [];
}
public function layout(): iterable
{
return [Layout::rows([
Button::make('Кнопка')->method('Save')
])];
}
public function Save()
{
echo $this->protected_property; // 'Some protected value'
echo $this->public_property; // null. WTF?!
}
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.