We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I have a doctrine_orm_time filter night_shift_start that is not mapped to my TimekeepingEntry admin:
doctrine_orm_time
night_shift_start
TimekeepingEntry
$datagridMapper ->add('night_shift_start', 'doctrine_orm_time', array( 'show_filter' => true, 'field_options' => array( 'hours' => array(20, 22), 'with_minutes' => false, 'mapped' => false ) ))
After setting the filter to a value and submitting I'm getting the following dump on the filter data in my custom CRUDController:
$datagrid = $this->admin->getDatagrid(); $datagridFilters = $datagrid->getFilters(); dump($datagridFilters);
As you can see the value index is not set and since then not available with:
value
echo $datagridFilters['night_shift_start']->getValue()['value'];
This seems to be caused by the mapped option. Setting the option to true and dumping without(!) submitting will show the expected format:
mapped
true
Submitting the filter is not possible: TimekeepingEntry has no field or association named night_shift_start
Any idea how to solve this?
BTW: why does the mapped option have to be set on the field_options and not the general third parameter array?
field_options
The text was updated successfully, but these errors were encountered:
I tried the following solution as workaround:
$nightShiftStart = $datagrid->getForm()->get('night_shift_start')->getData();
Seen on: http://stackoverflow.com/questions/20440836/sonata-admin-how-to-read-not-mapped-field
But the value will again be empty.
The only quick workaround I found:
$nightShiftStart = $request->get('filter')['night_shift_start']['value']['hour'];
Sorry, something went wrong.
This issue is very old. Can you please check this against the latest stable / master version?
Feel free to reopen, if the error still exists.
A PR would be welcome if you reopen this issue.
Sorry, but I'm no longer working on this project.
No branches or pull requests
I have a
doctrine_orm_time
filternight_shift_start
that is not mapped to myTimekeepingEntry
admin:After setting the filter to a value and submitting I'm getting the following dump on the filter data in my custom CRUDController:
As you can see the
value
index is not set and since then not available with:This seems to be caused by the
mapped
option. Setting the option totrue
and dumping without(!) submitting will show the expected format:Submitting the filter is not possible:
TimekeepingEntry has no field or association named night_shift_start
Any idea how to solve this?
BTW: why does the
mapped
option have to be set on thefield_options
and not the general third parameter array?The text was updated successfully, but these errors were encountered: