legionaire Posted November 1 Posted November 1 I get this error when attempting the code for my app Type of IPS\arcade\Member::$multitons must be array (as in class IPS\Patterns\ActiveRecord) in /home/ipsproarcade/public_html/testboard/applications/arcade/sources/Member/Member.php on line 85 Which is in direct relation to this code protected static $multitons; I have looked but cannot find an answer on how to correct this, could someone please help
teraßyte Posted November 1 Posted November 1 Try with this code to: protected static array $multitons;
legionaire Posted November 1 Author Posted November 1 Thanks teraByte, that seems to have worked, off to chase the next bug
legionaire Posted November 2 Author Posted November 2 Happened upon another error that I cannot see my way clear on, I get the following error, any help would be appreciated (learning as I go) TypeError: IPS\Http\Url::internal(): Argument #1 ($queryString) must be of type string, null given, called in /home/ipsproarcade/public_html/testboard/applications/arcade/sources/Library/Library.php on line 2086 (0) Which refers me to this section of the app code function startForm( $hiddens = '', $name = 'theAdminForm', $js = '', $id = '' ) { if ( !$id ) { $id = $name; } $form = "<form action='" . \IPS\Http\Url::internal( NULL ) . "' method='post' name='$name' $js id='$id'>"; if ( \is_array( $hiddens ) ) { foreach ( $hiddens as $v ) { $form .= "\n<input type='hidden' name='{$v[0]}' value='{$v[1]}' />"; } } return $form; }
teraßyte Posted November 2 Posted November 2 (edited) The problem is this line: \IPS\Http\Url::internal( NULL ) Try this instead: \IPS\Http\Url::internal( '' ) === Also, if you're expecting $hiddens to be an array, don't initialize it as an empty string: function startForm( $hiddens = array(), $name = 'theAdminForm', $js = '', $id = '' ) However, I see no point in starting a form with that function. Can't you use the \IPS\Helpers\Form class? It does the same and is entirely handled by the framework. 🤨 Edited November 2 by teraßyte
legionaire Posted November 2 Author Posted November 2 The first corrected the error, thanks and no idea how to make the change on your recommendation 😔 Quote However, I see no point in starting a form with that function. Can't you use the \IPS\Helpers\Form class? It does the same and is entirely handled by the framework
teraßyte Posted November 2 Posted November 2 Have a look at this guide: The guide is for v4, but it will work also for v5.
Recommended Posts