pdb-list template export not working correctly since last update
-
I have created the following template over 1.5 years ago, and I am calling it from a page with the following shortcode:
[pdb_list template=mcard orderby=”first_name” order=”asc” filter=”mtype=Member&paid_year=2022″ fields=”first_name, last_name, paid_year, maac, status”]
The content of the pdb-list-mcard.php located in the /public_html/wp/wp-content/themes/colormag-child/templates folder is:
<?php /* * * template for participants list shortcode output including a CSV download form * */ ?> <div class="wrap <?php echo $this->wrap_class ?>" id="<?php echo $this->list_anchor ?>"> <?php /* * SEARCH/SORT FORM * * the search/sort form is only presented when enabled in the shortcode. * */ $this->show_search_sort_form(); /* LIST DISPLAY */ /* * NOTE: the container for the list itself (excluding search and pagination * controls) must have a class of "list-container" for AJAX search/sort to * function */ ?> <table class="wp-list-table widefat fixed pages list-container" > <?php // print the count if enabled in the shortcode $this->print_list_count($wrap_tag = false); ?> <?php if ( $record_count > 0 ) : // print only if there are records to show ?> <thead> <tr> <?php /* * this function prints headers for all the fields * replacement codes: * %2$s is the form element type identifier * %1$s is the title of the field */ $this->print_header_row( '<th class="%2$s" scope="col">%1$s</th>' ); ?> </tr> </thead> <tbody> <?php while ( $this->have_records() ) : $this->the_record(); // each record is one row ?> <tr> <?php while( $this->have_fields() ) : $this->the_field(); // each field is one cell ?> <td class="<?php echo $this->field->name ?>-field"> <?php $this->field->print_value() ?> </td> <?php endwhile; // each field ?> </tr> <?php endwhile; // each record ?> </tbody> <?php else : // if there are no records ?> <tbody> <tr> <td><?php if ($this->is_search_result) echo Participants_Db::$plugin_options['no_records_message'] ?></td> </tr> </tbody> <?php endif; // $record_count > 0 ?> </table> <?php $this->show_pagination_control(); ?> <?php /** * prints the CSV download form * * @see full instructions on https://xnau.com/adding-a-csv-download-button/ * * @param array $config * 'title' => string the title for the export control * 'helptext' => string helptext to show with the control * 'button_text' => text shown on the download button * 'filename' => string initial name of the file * 'allow_user_filename' => bool if false, user cannot set filename * 'export_fields' => array of field names to include in the export */ $config = array( 'title' => '', 'helptext' => 'Click the "Download" button above to get the current membership list form membership cards', 'button_text' => 'Download', 'filename' => 'XXXXX-membership-card-list', 'allow_user_filename' => 'True', 'export_fields' => array( 'first_name', 'last_name', 'paid_year', 'maac', 'status', 'id' ) ); // this shows the form with all default values $this->csv_export_form( $config ); ?> </div>
Until recently I got the export as expected, but for the past few weeks – assuming since one of the latest updates – it is exporting the list with different fields:
first_name, last_name, city, state, zip, maac, year_born, type, status, year_joined,
paid_year, executive_position, comments, idit is a bit of inconvenience since our members starting to renew now, and we will need this export functionality to work almost on daily basis now.
Please let me know how can I fix this.
- The topic ‘pdb-list template export not working correctly since last update’ is closed to new replies.