Invision Community 4: SEO, prepare for v5 and dormant account notifications By Matt Monday at 02:04 PM
Foxtrek_64 Posted January 9, 2023 Posted January 9, 2023 Hello, I'm attempting to upgrade from v4.6.9 to 4.7.5. I was waiting for my host to provide newer versions of PHP and finally gave up and migrated to a new host. Everything's working on the new host with my board disabled, but I wanted to upgrade before I opened up my board again. When running the upgrade, I get the following exception: Fatal error: Declaration of IPS\form\_Log::getItemsWithPermission($where = [], $order = null, $limit = 10, $permissionKey = 'read', $includeHiddenItems = IPS\Content\Hideable::FILTER_AUTOMATIC, $queryFlags = 0, ?IPS\Member $member = null, $joinContainer = false, $joinComments = false, $joinReviews = false, $countOnly = false, $joins = null, $skipPermission = false, $joinTags = true, $joinAuthor = true, $joinLastCommenter = true, $showMovedLinks = false) must be compatible with IPS\Content\_Item::getItemsWithPermission($where = [], $order = null, $limit = 10, $permissionKey = 'read', $includeHiddenItems = IPS\Content\Hideable::FILTER_AUTOMATIC, $queryFlags = 0, ?IPS\Member $member = null, $joinContainer = false, $joinComments = false, $joinReviews = false, $countOnly = false, $joins = null, $skipPermission = false, $joinTags = true, $joinAuthor = true, $joinLastCommenter = true, $showMovedLinks = false, $location = null) in /home/public/applications/form/sources/Log/Log.php on line 730 I made sure I had followed the guide for changing hosting providers and everything appears to be fine there. I also downloaded a newer version of the ips4.php file and I pass all requirements (php memory is -1 which is less than 128M, which is why I think that error is shown. Not sure about the undefined array errors). What are my next troubleshooting steps for resolving the upgrade exception?
Solution Daniel F Posted January 9, 2023 Solution Posted January 9, 2023 That's an issue with a 3rd party application called forms Quote Fatal error: Declaration of IPS\form\_Log SJ77 1
Foxtrek_64 Posted January 9, 2023 Author Posted January 9, 2023 (edited) Thanks for the catch there, Daniel! I'll disable the plugin then upgrade again. That plugin has been giving me issues lately because despite having an upgrade itself, upgrading consistently fails. Haven't been able to resolve that one yet. Also, I made a change to the ips4.php document. I'm no php developer, but I was able to resolve the errors. What seems to be happening is `-1` doesn't match the regex string and the original code makes the assumption that the `memory_limit` will always be in the form of #g, #m, or #k. In an official change I'd probably check the length of $match before trying to grab the second entry. But this works as a quick proof of concept. <?php $_memoryLimit = @ini_get('memory_limit'); $memoryLimit = $_memoryLimit; if ($memoryLimit != '-1') { preg_match( "#^(\d+)(\w+)$#", strtolower($memoryLimit), $match ); if( $match[2] == 'g' ) { $memoryLimit = intval( $memoryLimit ) * 1024 * 1024 * 1024; } else if ( $match[2] == 'm' ) { $memoryLimit = intval( $memoryLimit ) * 1024 * 1024; } else if ( $match[2] == 'k' ) { $memoryLimit = intval( $memoryLimit ) * 1024; } else { $memoryLimit = intval( $memoryLimit ); } } ?> <?php if ( $memoryLimit == '-1' || $memoryLimit >= 128 * 1024 * 1024 ): ?> <li class="success"><?php echo $_memoryLimit; ?> memory limit.</li> <?php else: $success = FALSE; ?> <li class="fail">Your PHP memory limit is too low. It needs to be set to 128M or more. You should contact your hosting provider or system administrator to ask for this to be changed.</li> <?php endif; ?> Edited January 9, 2023 by Foxtrek_64
Recommended Posts