Plugin Directory

Changeset 3684871


Ignore:
Timestamp:
09/07/2026 12:23:23 PM (7 weeks ago)
Author:
ztwoods
Message:

Release 1.5.1

Location:
wbs-connect-for-dataverse/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • wbs-connect-for-dataverse/trunk/includes/collections.php

    r3684724 r3684871  
    192192        'entity_set'       => wbs_dataverse_connect_logical_name($config['entity_set'] ?? ''),
    193193        'name_column'      => wbs_dataverse_connect_logical_name($config['name_column'] ?? ''),
     194        'id_column'        => wbs_dataverse_connect_logical_name($config['id_column'] ?? ''),
    194195        'slug_column'      => wbs_dataverse_connect_logical_name($config['slug_column'] ?? ''),
    195196        'columns'          => wbs_dataverse_connect_logical_list($config['columns'] ?? []),
    … …  
    219220}
    220221
    221 /** Logical name of the collection's primary key column. */
     222/**
     223 * Logical name of the collection's primary key column: the configured
     224 * id_column, else the table's PrimaryIdAttribute from metadata, else the
     225 * <table>id convention. Activity tables (task, email, appointment) use
     226 * activityid, which is why the convention alone is not enough.
     227 */
    222228function wbs_dataverse_connect_id_column($config) {
    223     return $config['table'] . 'id';
     229    if (!empty($config['id_column'])) {
     230        return $config['id_column'];
     231    }
     232    static $memo = [];
     233    $table = (string) $config['table'];
     234    if (!array_key_exists($table, $memo)) {
     235        $memo[$table] = '';
     236        if (function_exists('wbs_dataverse_connect_metadata_entity')) {
     237            $entity = wbs_dataverse_connect_metadata_entity($table, ['type' => 'metadata', 'config' => $config]);
     238            if (is_array($entity) && !empty($entity['primary_id'])) {
     239                $memo[$table] = wbs_dataverse_connect_logical_name($entity['primary_id']);
     240            }
     241        }
     242    }
     243    return $memo[$table] !== '' ? $memo[$table] : $table . 'id';
    224244}
    225245
  • wbs-connect-for-dataverse/trunk/readme.txt

    r3684724 r3684871  
    55Tested up to: 7.1
    66Requires PHP: 8.0
    7 Stable tag: 1.5.0
     7Stable tag: 1.5.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
    … …  
    107107== Changelog ==
    108108
     109= 1.5.1 =
     110* Primary key from metadata: collections over activity tables (task, email, appointment, phone call) and any other table whose key is not <table>id now work; an explicit id_column can also be set in code. Found while testing the Pro Business tier live.
     111
    109112= 1.5.0 =
    110113* Search, filters and sort on collections: pick the columns on the Collections tab and visitors get a search box, filter dropdowns and sort choices that work without JavaScript. The [wbsdvc_collection] shortcode accepts per_page, search, filters and sort.
  • wbs-connect-for-dataverse/trunk/wbs-connect-for-dataverse.php

    r3684724 r3684871  
    44 * Plugin URI: https://woods.consulting/wbs-dataverse-connect-for-wordpress/
    55 * Description: Publish Microsoft Dataverse records as lists and detail views on your WordPress site, and write form submissions straight back into Dataverse tables.
    6  * Version: 1.5.0
     6 * Version: 1.5.1
    77 * Author: WOODS Business Solutions
    88 * Author URI: https://woods.consulting
    … …  
    1616if (!defined('ABSPATH')) { exit; }
    1717
    18 define('WBS_DATAVERSE_CONNECT_VERSION', '1.5.0');
     18define('WBS_DATAVERSE_CONNECT_VERSION', '1.5.1');
    1919define('WBS_DATAVERSE_CONNECT_PATH', plugin_dir_path(__FILE__));
    2020define('WBS_DATAVERSE_CONNECT_URL',  plugin_dir_url(__FILE__));
Note: See TracChangeset for help on using the changeset viewer.