Viewing 5 reply threads
  • Author
    Posts
    • #5227
      bjoerns
      Member

      Hi Steve

      Has the bugs with file upload in group fields been resolved (see here)? Because I’m also having very strange things happening when using the code below: some data get saved in the database, others not and all of this in an array which doesn’t look as the example here.

      In a second attempt I tried without grouping by commenting out the line “,’field’ => ‘ausbildung_zeugnis” in the code below, but then it’s even worse: I created two “Diplom/Zeugnis” (see code below) and in each of them I attached a pdf (see code below with field ‘ausbildung_zeugnis_pdf’) and an image (ausbildung_zeugnis_bild). The form behaves normal, but after publishing my custom post entry the two “Diplom/Zeugnis” are gone and I also don’t see in the post_meta-database table any entries.

      Is this a bug or am I doing things the wrong way? If it is a bug: Can you propose a work-around?

      Kind regards
      Björn

      array(
      			'type' => 'group'
      			,'field' => 'ausbildung_zeugnis'
      			,'label' => __('Diplom/Zeugnis')
      			,'columns' => '12'
      			,'add_more' => true
      			,'fields' => array(
      				array(
      					'type' => 'text'
      					,'field' => 'ausbildung_zeugnis_bezeichnung'
      					,'label' => __('Bezeichnung')
      					,'columns' => '6'
      					,'help' => __('Wie heisst das Zeugnis? Entspricht normalerweise dem Dateinamen')
      				),
      				array(
      					'type' => 'file'
      					,'field' => 'ausbildung_zeugnis_pdf'
      					,'label' => __('PDF','piklist')
      					,'columns' => '3'
      					,'help' => __('Bitte laden Sie hier das Zeugnis als PDF-Datei hoch')
      					,'options' => array(
      						'modal_title' => __('PDF hinzufügen','piklist')
      						,'button' => __('PDF hinzufügen','piklist')
      					)
      					,'validate' => array(
      						array(
      							'type' => 'limit',
      							'options' => array(
      								'min' => 1,
      								'max' => 1
      							)
      						)
      					)
      				),
      				array(
      					'type' => 'file'
      					,'field' => 'ausbildung_zeugnis_bild'
      					,'label' => __('Titelbild','piklist')
      					,'columns' => '3'
      					,'help' => __('Bitte laden Sie hier ein Titelbild der PDF-Datei hoch')
      					,'options' => array(
      						'modal_title' => __('Bild hinzufügen','piklist')
      						,'button' => __('Bild hinzufügen','piklist')
      					)
      					,'validate' => array(
      						array(
      							'type' => 'limit',
      							'options' => array(
      								'min' => 1,
      								'max' => 1
      							)
      						)
      					)
      				)
      			)
      		),
    • #5247
      Steve
      Keymaster

      You code doesn’t look like it’s wrapped in a Piklist field array, so I update it. This code works for me.

      Your code should be saved to this field: ausbildung_zeugnis.

        piklist('field', array(
            'type' => 'group'
            ,'field' => 'ausbildung_zeugnis'
            ,'label' => __('Diplom/Zeugnis')
            ,'columns' => '12'
            ,'add_more' => true
            ,'fields' => array(
              array(
                'type' => 'text'
                ,'field' => 'ausbildung_zeugnis_bezeichnung'
                ,'label' => __('Bezeichnung')
                ,'columns' => '6'
                ,'help' => __('Wie heisst das Zeugnis? Entspricht normalerweise dem Dateinamen')
              ),
              array(
                'type' => 'file'
                ,'field' => 'ausbildung_zeugnis_pdf'
                ,'label' => __('PDF','piklist')
                ,'columns' => '3'
                ,'help' => __('Bitte laden Sie hier das Zeugnis als PDF-Datei hoch')
                ,'options' => array(
                  'modal_title' => __('PDF hinzufügen','piklist')
                  ,'button' => __('PDF hinzufügen','piklist')
                )
                ,'validate' => array(
                  array(
                    'type' => 'limit',
                    'options' => array(
                      'min' => 1,
                      'max' => 1
                    )
                  )
                )
              ),
              array(
                'type' => 'file'
                ,'field' => 'ausbildung_zeugnis_bild'
                ,'label' => __('Titelbild','piklist')
                ,'columns' => '3'
                ,'help' => __('Bitte laden Sie hier ein Titelbild der PDF-Datei hoch')
                ,'options' => array(
                  'modal_title' => __('Bild hinzufügen','piklist')
                  ,'button' => __('Bild hinzufügen','piklist')
                )
                ,'validate' => array(
                  array(
                    'type' => 'limit',
                    'options' => array(
                      'min' => 1,
                      'max' => 1
                    )
                  )
                )
              )
            )
        ));
      
    • #5259
      bjoerns
      Member

      Hi Steve

      Thank you for looking into this issue. In my last post I forgot to mention, that my code was only an excerpt of a “bigger” field array. But nevertheless I tried your code, but it doesn’t work neither.

      Instead of many words I made a screencast of the weird things happening: https://youtu.be/U1llFRJAIs8. I hope, you can help me solving this. By the way: I’m using version 0.9.4.29 of piklist in a multisite environment (plugin is activated network wide).

      Kind regards
      Björn

    • #5263
      Steve
      Keymaster

      Hi Björn– Try using our latest beta. I believe it will fix your issues.

    • #5266
      bjoerns
      Member

      Hi Steve

      Thank you very much. It works now well. There is only a new bug concerning validation and a very minor bug concerning display of pdf. Both are shown in a very short screencast: https://youtu.be/77JTmiJRwEQ.

      Kind regards
      Björn

    • #5273
      Steve
      Keymaster

      @bjoerns– The screencast really helped! We’ll look into these issues.

Viewing 5 reply threads
  • You must be logged in to reply to this topic.