Jump to content

DawPi

Clients
  • Posts

    8,450
  • Joined

  • Last visited

  • Days Won

    20

 Content Type 

Downloads

Release Notes

IPS4 Guides

IPS4 Developer Documentation

Invision Community Blog

Development Blog

Deprecation Tracker

Providers Directory

Projects

Release Notes v5

Invision Community 5 Bug Tracker

Forums

Events

Store

Gallery

Posts posted by DawPi

  1. Hello,

    it's pretty simple to reproduce. The stack part:

    $form->add( new \IPS\Helpers\Form\Stack( 'myapp_authors', ! empty( $authors ) ? $authors : array(), TRUE, array( 'stackFieldType' => '\IPS\myapp\Form\File', 'maxItems' => 5, 'key' => array( 'placeholder' => \IPS\Member::loggedIn()->language()->addToStack( 'myapp_enter_name_placeholder' ), 'size' => 20 ), 'value' => array( 'min' => 0, 'max' => 100 ) ), NULL, NULL, NULL, 'myapp_authors' ) );

    And custom form field type constructor from myapp\(sources)Form\File:

    	/**
    	 * Constructor
    	 * Creates the two date objects
    	 *
    	 * @param	string		$name			Form helper name
    	 * @param	mixed		$defaultValue	Default value for the helper
    	 * @param	bool		$required		Helper is required (TRUE) or not (FALSE)
    	 * @param	array		$options		Options for the helper instance
    	 * @see		\IPS\Helpers\Form\Abstract::__construct
    	 * @return	void
    	 */
    	public function __construct( $name, $defaultValue=NULL, $required=FALSE, $options=array() )
    	{
    		$options = array_merge( $this->defaultOptions, $options );
    
    		parent::__construct( $name, $defaultValue, $required, $options );
    
            $this->keyField = new \IPS\Helpers\Form\Member( "{$name}[key]", isset( $defaultValue['key'] ) ? \IPS\Member::load( $defaultValue['key'] ) : NULL, TRUE, array(), NULL, NULL, NULL, "{$name}[key]" );
            
    		$this->valueField = new \IPS\Helpers\Form\Number( "{$name}[value]", isset( $defaultValue['value'] ) ? $defaultValue['value'] : NULL, FALSE, isset( $options['value'] ) ? $options['value'] : array() );
    	}

     

    And this is how it works and looks like:

     

    Is this a known issue or someone know how to fix it? 🤔

    Thanks in advance!

  2. 2 hours ago, teraßyte said:

    It seems the post I made earlier, right before this one, is throwing an error. 🤨

    [[Template forums/front/topics/postContainer is throwing an error. This theme may be out of date. Run the support tool in the AdminCP to restore the default theme.]]

     

    Fixed -

     

×
×
  • Create New...