Giter Site home page Giter Site logo

Comments (6)

lsgs avatar lsgs commented on September 28, 2024

Thanks for the report @biggeeves. I'm not sure I understand what the problem is the release v1.0.0 of this EM though. The method definitions may not be up-to-date with type specifications, but that should not be a problem. There are no default values specified, so there are no optional parameters occurring before required parameters (which - yes - is indeed an issue with PHP 8).

Can you explain further please? Are you receiving some error message because the methods of this EM do not contain the type specifications?

from redcap-event-navigation-tweaks.

biggeeves avatar biggeeves commented on September 28, 2024

When using default arguments, any defaults should be on the right side of any non-default arguments; otherwise, things will not work as expected.

$instrument and $event_id are after the first default variable $record. If $record was AFTER $instrument and $event_id, this would not be an issue. But it does come before, thus the warning in PHP 8.

redcap_data_entry_form_top ( $project_id, $record = NULL, $instrument, $event_id, $group_id = NULL, $repeat_instance = 1 )

from redcap-event-navigation-tweaks.

lsgs avatar lsgs commented on September 28, 2024

I understand the principle, @biggeeves, and have made this fix in some of my other EMs. I can't see how it is a problem in this one though...

public function redcap_data_entry_form_top($project_id, $record, $instrument, $event_id, $group_id, $repeat_instance) {

from redcap-event-navigation-tweaks.

biggeeves avatar biggeeves commented on September 28, 2024

from redcap-event-navigation-tweaks.

lsgs avatar lsgs commented on September 28, 2024

A new report of an exception thrown in an instance running on PHP 8.1:

The 'event_navigation_tweaks' module threw the following exception when calling the hook method 'redcap_data_entry_form_top':

TypeError: array_key_exists(): Argument #2 ($array) must be of type array, null given in /var/www/redcap/modules/event_navigation_tweaks_v1.0.0/EventNavigationTweaks.php:111
Stack trace:
#0 /var/www/redcap/modules/event_navigation_tweaks_v1.0.0/EventNavigationTweaks.php(111): array_key_exists()
#1 /var/www/redcap/modules/event_navigation_tweaks_v1.0.0/EventNavigationTweaks.php(18): MCRI\EventNavigationTweaks\EventNavigationTweaks->makeEventNavPopoverContent()
#2 /var/www/redcap/redcap_v13.7.13/ExternalModules/classes/ExternalModules.php(3165): MCRI\EventNavigationTweaks\EventNavigationTweaks->redcap_data_entry_form_top()
#3 /var/www/redcap/redcap_v13.7.13/ExternalModules/classes/ExternalModules.php(3330): ExternalModules\ExternalModules::startHook()
#4 /var/www/redcap/redcap_v13.7.13/ExternalModules/classes/ExternalModules.php(3363): ExternalModules\ExternalModules::ExternalModules\{closure}()
#5 /var/www/redcap/redcap_v13.7.13/Classes/Hooks.php(42): ExternalModules\ExternalModules::callHook()
#6 /var/www/redcap/redcap_v13.7.13/DataEntry/index.php(533): Hooks::call()
#7 {main}

from redcap-event-navigation-tweaks.

lsgs avatar lsgs commented on September 28, 2024

Function argument default values checked. Release v1.01 contains bug fix for PHP8 relating to array access along with a couple of things for Bootstrap 5 compatibility.

from redcap-event-navigation-tweaks.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.