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

Upgrade PHPWord #13686

Merged
merged 1 commit into from
Feb 27, 2019
Merged

Conversation

seamuslee001
Copy link
Contributor

No description provided.

@civibot
Copy link

civibot bot commented Feb 23, 2019

(Standard links)

@civibot civibot bot added the master label Feb 23, 2019
$xml = simplexml_load_file($name);
self::readXML($xml, $menu);
libxml_disable_entity_loader(TRUE);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The general pattern for doing this safely as well-behaved member of a complex system is:

$backupValueThatIDontMakeAnyAssumptionsAbout = readTheGlobalValue():
setTheGlobalValue($theValueThatILike);
try {
   doTheMainThing();
}
finally {
  setTheGlobalValue($backupValueThatIDontMakeAnyAssumptionsAbout);
}

On a case-by-cases basis, there might be a prettier way (e.g. maybe depending on the contract of the specific global-thing or maybe using CRM_Utils_AutoClean::swap() or maybe using CRM_Utils_GlobalStack).

@seamuslee001 seamuslee001 force-pushed the phpword_upgrade branch 2 times, most recently from b3b29db to 4947d38 Compare February 24, 2019 02:50
@seamuslee001
Copy link
Contributor Author

@totten got it to pass :-)

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 are there remaining reasons not to merge now?

@seamuslee001
Copy link
Contributor Author

nothing on my side but would appreciate Tim's opinion as well

@eileenmcnaughton eileenmcnaughton added the merge ready PR will be merged after a few days if there are no objections label Feb 24, 2019
Patch phpword install to fix global handling of disable libxml entity loader

Fix phpoffice/common as well
@seamuslee001
Copy link
Contributor Author

Jenkins re test this please

@eileenmcnaughton
Copy link
Contributor

We should actually go to the latest version I think
https://github.com/PHPOffice/PHPWord/releases

My experience with phpword is that we have had more than one case where the fix to some reported issue is to upgrade - as long as it's compatible with our min php version I think keeping it current solves more problems than it's likely to risk causing

@colemanw
Copy link
Member

Looks like the latest is v0.16.

@seamuslee001 will that newer version still require your entity_loader patch?

@seamuslee001
Copy link
Contributor Author

@colemanw yes it would still need those patches

@eileenmcnaughton
Copy link
Contributor

So I'm happy to merge this as a 'technical' fix to the problem of 'how do we upgrade phpword - although getting the latest bug fixes would be better

@eileenmcnaughton eileenmcnaughton merged commit b0d4986 into civicrm:master Feb 27, 2019
@eileenmcnaughton eileenmcnaughton deleted the phpword_upgrade branch February 27, 2019 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master merge ready PR will be merged after a few days if there are no objections
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants