Tagged: add_more, file upload
- This topic has 5 replies, 2 voices, and was last updated 6 years, 2 months ago by
Steve.
-
AuthorPosts
-
-
December 4, 2015 at 1:06 pm #5227
bjoernsMemberHi 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örnarray( '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 ) ) ) ) ) ), -
December 7, 2015 at 12:17 pm #5247
SteveKeymasterYou 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 ) ) ) ) ) )); -
December 8, 2015 at 4:06 am #5259
bjoernsMemberHi 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 -
December 8, 2015 at 11:59 am #5263
SteveKeymasterHi Björn– Try using our latest beta. I believe it will fix your issues.
-
December 8, 2015 at 1:21 pm #5266
bjoernsMemberHi 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 -
December 9, 2015 at 10:47 am #5273
-
-
AuthorPosts
- You must be logged in to reply to this topic.