-
-
Notifications
You must be signed in to change notification settings - Fork 825
New issue
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
Export fix #17644
Export fix #17644
Conversation
(Standard links)
|
76d66f2
to
239d4cf
Compare
CRM/Export/Form/Select.php
Outdated
// Contact | ||
$entityShortname = $componentName[1]; | ||
$entityDAOName = $entityShortname; | ||
$entityShortname = $entityDAOName = $this->getComponentName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is incorrect; those two variables are not always the same, see for example CRM_Export_Controller_Standalone::$components['Membership'] == 'Member'
Granted the names of these variables is confusing. By "short name" they actually mean "component name"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@colemanw can you push up a fix to address that? same pattern I think (FWIW I think the whole switch could be in those functions....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton stepping through this code, every condition in this switch statement appears to be unreachable except for the default
. I put a breakpoint in each of the switch conditions and couldn't trigger any of them, using standalone export or the various component search screens.
Are you seeing the same thing? Can we just remove the whole switch()
and always use the default condition?
@eileenmcnaughton I just pushed up a commit removing the |
108fcff
to
5d8332b
Compare
CRM/Export/Form/Select.php
Outdated
$entityShortname = 'Case'; | ||
$entityDAOName = $entityShortname; | ||
break; | ||
$components = CRM_Export_Controller_Standalone::$components; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you need to move this static to this form of 'somewhere' central if using from this form
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eileenmcnaughton done
5d8332b
to
e011de2
Compare
This needs careful review and testing. I'm not specifically using this code but was responsible for a lot of the earlier cleanup around this (starting with #11536). That switch statement is reachable from core (or at least was until very recently). - I'm sorry but I don't remember how... but likely through a combination of search tasks and entities. I am very much in favour of trying to clean it up and/or remove it but we do need to steop carefully. |
Actually it's easy to reach - just use advanced search and select "display results as"->"contributions (or any other choice of entity) - that will set queryMode and take you to a specific case in that switch. |
e011de2
to
d532b68
Compare
Thanks @mattwire I've restored the switch so my changes are now fairly minimal. |
Lets merge this then - I do think the switch could be improved but actually queryMode is more reliable than formName when I think about it. Anyway that has now been punted |
@eileenmcnaughton Agree I'd be happy to see this cleaned up further, but I remember it being somewhat non-trivial to debug! |
Overview
Alternative to https://github.com/civicrm/civicrm-core/pull/17590/files
@colemanw the code that was hurting you actually only existed to support this class - so I ripped it out & It seems to work...
Before
After
Technical Details
Comments