Skip to content
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

PCHR-4473: Run tests on CiviCRM 5.12.0 #2983

Draft
wants to merge 40 commits into
base: master
Choose a base branch
from

Conversation

davialexandre
Copy link
Member

WIP

davialexandre and others added 30 commits August 31, 2018 10:44
…st::retrieve()

The main reason for this is that `$this` was being passed as the store param
in places that we didn't have a context object (i.e. outside of a instance
method). Up to PHP 7.0, this would work without a problem, but starting
from PHP 7.1, this now results in an error: https://3v4l.org/QXYLB

In a few places, instead of $this, `CRM_Core_DAO::$_nullObject` was being
used. This is a risky approach, as it's possible for $_nullObject to not
be null (it is just an public static property of the DAO class). This
has been removed as well
…ript

PCHR-3681: Remove unnecessary param in calls to CRM_Utils_Request::retrieve()
…FullDetails API

This API call is an optimized way to fetch all the information for a Job Contract,
which is stored in multiple different database tables. It does that by running
a single SQL query, joining all the tables and the necessary fields.

In the resultset, in order to differentiate which field belongs to which entity,
each field is prefixed with the entity name (examplei: details__<field_name>). After
the data is fetched from the database, the `HRJobContractRevision::normalizeFullDetailsResult()`
was used to loop through all the fields in the resultset, detect to which entity they
belong to and organize the data in a proper way.

Besides the fields returned by the query, the resultset object also contains some internal
fields. In the past, all of these fields were prefixed with an underscore, but on
civicrm/civicrm-core#12276 a new `resultCopies` field was added,
and since it does not start with an underscore, the logic to filter out the internal
fields stopped working. To fix that, instead of looping through all of the fields from
the resultset, we call the `toArray()` method which will return a list of fields and
values containing only those returned by the SQL query.
In civicrm/civicrm-core@4aced66, the Summary.tpl
file has been refactored in core and part of it was extracted to the
Basic.tpl template.

Our customization was located exactly in the piece of code that has been
extracted, so the sync was done by:

- Overridding the Basic.tpl template in hrui
- Moving the custom code from the Summary.tpl file to the new Basic.tpl one
- Deleting the old Summary.tpl file, as it didn't contain any custom code anymore

As part of this, I also did some small refactoring in the custom code,
removing some unecessary ifs and custom variables to make it less different
from the original file as possible
The only reason we needed the overridden file was to fix an
error in CiviCRM Core. Since this has been now fixed in core,
we don't need to file anymore.

References: civicrm/civicrm-core#13031
compucorp/civicrm-core#28
…arning

PCHR-4426: Fix warning on the Work Patterns list page
Due to the difference in how PHP 7 handles variable variables,
a couple of notices about undefined variables and invalid function
names started appearing on the L&A settings page.

This PR fixes the issue by simplifying how we call the method in the
html_type setting.
…rror

PCHR-4441: Fix errors on the L&A settings page
Now that the final version has been released, we don't
need to use the branch version anymore
PCHR-4446: Fix Expected Variable Reference Warning
…-errors

PCHR-4448: Fix Warning and Notice Messages on Import Job Contract Wizard
tunbola and others added 6 commits December 14, 2018 18:00
Since CiviCRM 5.8, the tabs now have icons by default. Some of them are
different from the ones used in CiviHR so we have to customize them to
the ones we want.

The tabset hook was used to set the custom icons. For icons in core tabs,
the hrcore does the customization. For the other tabs, the customization
was done in the extension the tab belongs to.

As part of the change in core to support those icons, they also changed
the markup of the tab and now the label/title is wrapped around a `span`
tag. This change broke some javascript code in the hrui extension that
was renaming the title of the summary tab to "Personal Details", as the
jQuery code used there was not aware of the span and was replacing the
entire tab text instead of only the span, resulting in it removing the
icon. This was fixed by using the tabset in hrcore to replace the text.
This way, even if the markup changes again in the future, the replacement
will still work
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants