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

Fixed reference errors for PHP7.1 in frontend #581

Closed
herrvigg opened this issue Jun 24, 2018 · 3 comments
Closed

Fixed reference errors for PHP7.1 in frontend #581

herrvigg opened this issue Jun 24, 2018 · 3 comments
Labels
legacy PR Legacy PR imported from original repo

Comments

@herrvigg
Copy link
Collaborator

Issue by GasimGasimzada
Tuesday Apr 03, 2018 at 19:44 GMT
Originally opened as qTranslate-Team/qtranslate-x#581



GasimGasimzada included the following code: https://github.com/qTranslate-Team/qtranslate-x/pull/581/commits

@herrvigg herrvigg added the legacy PR Legacy PR imported from original repo label Jun 24, 2018
@herrvigg
Copy link
Collaborator Author

@GasimGasimzada Most of the requested changes are fixed in qTranslate-XT 3.5.0: 612c9f7

This should fix all the reference errors. However your PR/581 had some other stuff:

  • remove references from functions:
    • qtranxf_add_language_menu_item(&$items, &$menu_order, &$itemid, $key, $language )
    • qtranxf_remove_detached_children(&$items,&$itemsremoved)
  • in function qtranxf_translate_metadata remove references from these assignements:
    • $meta_unserialized = &$meta_cache_unserialized[$meta_type][$object_id];
    • $meta_key_unserialized = &$meta_unserialized[$meta_key];

I'm not sure why we you asked to remove these references. They are still in the current version of qTranslate-XT and i have not seen such warnings anymore. The 2 functions are not related to WP hooks but called internally. Also, removing the refs from the variables could have some undesired side-effects so it has to be done carefully. Are you sure you want to remove those? If so, could you better explain?

Also your PR asked for other things such as Composer but for the moment this -XT plugin is only on github so we should look at this later.

@GasimGasimzada
Copy link
Contributor

To be honest, I just removed all references when I saw the error and everything worked. It might have been a mistake on my part at the time. You can close this issue if there is no problem.

@herrvigg
Copy link
Collaborator Author

OK :)
Yes i don't think the other changes are necessary for now but they might be reviewed again in the future if we refactor some stuff. I don't really know why references are used in the existing code here, in general i think they should be avoided because it generates many side-effect errors. But removing them could also create some regressions so i'm super cautious with that ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy PR Legacy PR imported from original repo
Projects
None yet
Development

No branches or pull requests

2 participants