-
-
Notifications
You must be signed in to change notification settings - Fork 212
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 7.3 Strict Standards #2146
Comments
yep. These as nasty bugs in the heart of the e107 class structure. "Fixing" them has the potential to break a LOT of stuff. I think we'll need @myovchev to give some feedback before modifying this. I managed to eliminate about 4 or them some time ago, but these are trickier. |
I'm adding $id=null, to 3194 and leaving it there for a while to see if it helps. public function load($id=null, $force = false) |
Good explanation here... http://stackoverflow.com/questions/3115388/declaration-of-methods-should-be-compatible-with-parent-methods-in-php "This message means that there are certain possible method calls which may fail at run-time. Suppose you have .... " |
Line 504: class e_model extends e_object Line 1842: class e_front_model extends e_model Line 3048: class e_tree_model extends e_front_model Line 3453: class e_front_tree_model extends e_tree_model The functions in extended classes need to have the same parameters as the parent class. Please can you advise @myovchev? |
Not quite right, you can override a function on a child class with different parameters. |
OK, thanks @rica-carv fair enough. Just getting lots of error_log files whilst debugging LANs work. If it's nothing to worry about that's fine. :) Just need to clean the files out from time to time. |
@CaMer0n What's the status on this one? |
After starting to utilize cron.php for an installation the following errors started to be generated in the installations root error_log - Appears to be part of the issue above. (PHP Version 7.1.17) PHP Warning: Declaration of e_tree_model::load($force = false) should be compatible with e_front_model::load($id = NULL, $force = false) in /e107_handlers/model_class.php on line 3520 PHP Warning: Declaration of e_front_tree_model::update($field, $value, $ids, $syncvalue = NULL, $sanitize = true, $session_messages = false) should be compatible with e_tree_model::update($from_post = true, $force = false, $session_messages = false) in /e107_handlers/model_class.php on line 3654 |
A refactoring attempt available in https://github.com/e107inc/e107/tree/bugfix/2146-model-refactoring |
@CaMer0n: The strict warnings are a sign that the things in Although @myovchev's refactoring may squelch the warnings, there are still abstraction problems. For example, In my opinion, @myovchev's change is not nearly radical enough. The only way I can see this code get better is if we create an object-relational mapping that has minimal dependency on the rest of e107 and a clean interface… and then plug in the old Of course, this is an enormous amount of effort, but how else would we make e107 a cleaner codebase? |
@Deltik I believe I have committed a partial fix. Please let me know what you think. |
I guess what you mean by partial is this lingering issue:
The inheritance hierarchy goes To fix this one, consider how this It appears to me that If I could redo the e107 ORM, I would make Unfortunately, the way that the "collection" concept has mixed with the "model" concept means that any attempt to work around this mismatched declaration would just make the code worse. |
Thanks @Deltik !! :-) I'm thinking renaming load to loadBatch or loadMultiple() would be easier at this stage than a rewrite. |
How about |
It's nice, but it seems a little inconsistent to me with the terminology already used. We're talking about loading multiple rows, right? Currently when we edit those rows we call it a batch edit. What do you think? |
Okay, fair. |
👍 I'm not sure what kind of cascading effect this could have on other methods. Hopefully nothing that would be used by third-party plugins/themes. |
@CaMer0n Unfortunatelly, you can't control what third party plugins do, so isn't better to just leave a remark on this build history regarding this renaming? |
@rica-carv That's all fine and well, until it's a third-party plugin on your site that fails and breaks your whole site after upgrading e107. I'm just looking for the least 'damaging' change possible. |
@Deltik I made the change by renaming to loadBatch(). Hopefully nothing broke. If you spot anything unusual, please let me know. Thank you. |
@CaMer0n |
Confirmed theme manager issue ("No records found") |
Theme menu indeed fixed. So far, no issues with news on admin area or frontend. |
@Jimmi08 Featurebox should be working now. |
@CaMer0n Confirmed, featurebox works now. |
@Moc Could you confirm this? It worked before this change. Problem with correct layout for page . How to test this:
PHP 7.0. |
@Jimmi08: I noticed that your screenshot has a comma ( |
@Deltik Thanks. Good eye. Now I need to find how I got it there... yes, this was problem, but I didn't see it before. |
@Jimmi08 Check theme.xml - it's a common mistake. |
I think this one can be closed. Feel free to let me know if there's still an issue related to this, and I'll re-open. |
PHP 5.6 in Admin > file_inspector then you find entries in error_log file in the admin folder.
PHP Strict Standards: Declaration of e_tree_model::load() should be compatible with e_front_model::load($id = NULL, $force = false) in e107_handlers/model_class.php on line 3449
class e_front_model extends e_model
2509
class e_tree_model extends e_front_model
3194
Adding the ID Parameter seems to eliminate the error_log message, not sure what impact it could have.
Secondly bit more involved... not sure what to do with this one.
The text was updated successfully, but these errors were encountered: