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

dev/translation#9 Create API Action to rebuild Multilingual Schema #11967

Merged
merged 1 commit into from
Apr 19, 2018

Conversation

seamuslee001
Copy link
Contributor

Overview

Create an API tool to allow folks to rebuild the multilingual schema

Before

Have to use cli tools to rebuild schema

After

able to rebuild schema using the API

ping @eileenmcnaughton @mlutfy This isn't the perfect solution at least it should make it easier for folks to get out of trouble hopefully

* Rebuild Multilingual Schema
*
*/
function civicrm_api3_system_rebuildMultilingualSchema() {
Copy link
Contributor

Choose a reason for hiding this comment

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

convention is all lower

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorted

@eileenmcnaughton
Copy link
Contributor

I'm happy with this in principle - I can't see a downside

@eileenmcnaughton
Copy link
Contributor

@seamuslee001 can we alter an existing test to call this? I could make a case for not having a test here - but it also feels like it might not be that hard if there are existing tests

@eileenmcnaughton
Copy link
Contributor

I wonder if we should tie in with system.flush api (that rebuilds triggers if trigger=1)

@seamuslee001
Copy link
Contributor Author

Yeh might be not the worst idea

return civicrm_api3_create_success(1);
}
else {
throw new API_Exception('Cannot call rebuild Multilingual scheama on non Multilingual database');
Copy link
Member

Choose a reason for hiding this comment

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

typo in "scheama"

@mlutfy
Copy link
Member

mlutfy commented Apr 17, 2018

I was also initially going to suggest system.flush multilingual=1, but seems like we already have a few functions that are not tied to flush, ex:

function civicrm_api3_system_updatelogtables() {
function civicrm_api3_system_updateindexes() {
function civicrm_api3_system_createmissinglogtables() {

whereas we also have triggers on system.flush. And to think about it, this is a bit more than a cache flush, so makes sense to keep it separate?

@eileenmcnaughton
Copy link
Contributor

Yeah - I'm kinda 6 one way & half a dozen the other on adding to flush vs it's own fn

@mlutfy
Copy link
Member

mlutfy commented Apr 19, 2018

@seamuslee001 Can you fix the typo, and we can merge?

@seamuslee001
Copy link
Contributor Author

@mlutfy done

@eileenmcnaughton
Copy link
Contributor

Merging this as on balance it helps us deal with support issues & any downside is kinda esoteric

@eileenmcnaughton eileenmcnaughton merged commit d15b4e5 into civicrm:master Apr 19, 2018
@eileenmcnaughton eileenmcnaughton deleted the dev_translation_9 branch April 19, 2018 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants