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

PHP warning caused by duplicate property definition #140

Closed
gyula-szabo opened this issue Sep 7, 2018 · 7 comments
Closed

PHP warning caused by duplicate property definition #140

gyula-szabo opened this issue Sep 7, 2018 · 7 comments

Comments

@gyula-szabo
Copy link

gyula-szabo commented Sep 7, 2018

Hello there!

The latest version of yii2-krajee-base breaks the file input widget under PHP 5.6.

Steps to reproduce the issue

  1. Update yii2-krajee-base to latest release
  2. Try to use the file input widget under PHP 5.6 with strict warnings enabled

Expected behavior and actual behavior

Following the steps above, this warning is thrown:
file_input_warning

This is not the case using at least PHP 7.0, or even disabling strict warnings, but there can be (and there are, in fact) hosts where we cannot turn off the warnings even if we want to, so it would still be great to fix this.

Environment

Libraries

  • yii2-krajee-base version: 1.9.4
  • yii2-widget-fileinput version: 1.0.6

It seems to me that this needs to be fixed in this extension, and not in yii2-krajee-base, I hope I am correct in opening the issue here.

@cshehadi
Copy link

cshehadi commented Sep 7, 2018

+1

@kartik-v
Copy link
Owner

kartik-v commented Sep 7, 2018

Update to latest release and let know

@kartik-v kartik-v closed this as completed Sep 7, 2018
@gyula-szabo
Copy link
Author

It is now:

kartik\base\InputWidget and kartik\base\TranslationTrait define the same property ($i18n) in the composition of kartik\file\FileInput. This might be incompatible, to improve maintainability consider using accessor methods in traits instead. Class was composed

Both InputWidget and FileInput use TranslationTrait. Looks like PHP doesn't like this duplication. I removed the use TranslationTrait; line from FileInput to test the theory and it started working again.

@kartik-v kartik-v reopened this Sep 7, 2018
@kartik-v
Copy link
Owner

kartik-v commented Sep 7, 2018

Fixed

@rklvnoe
Copy link

rklvnoe commented Sep 11, 2018

The row with use TranslationTrait is still in the repositorty?
I still geht the error.

@kartik-v
Copy link
Owner

kartik-v commented Sep 11, 2018

Not sure what you are checking. Latest release for you to update to is v1.0.7 and you can cross check the latest updated code for FileInput.

@amonline
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants