Skip to content

Fix listing export multi-directory custom fields - #2987

Open
Arafat-plugins wants to merge 1 commit into
sovware:developmentfrom
Arafat-plugins:fix/listing-export-multidirectory-columns
Open

Fix listing export multi-directory custom fields#2987
Arafat-plugins wants to merge 1 commit into
sovware:developmentfrom
Arafat-plugins:fix/listing-export-multidirectory-columns

Conversation

@Arafat-plugins

Copy link
Copy Markdown
Contributor

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Security fix
  • Improvement
  • New Feature
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Text changes
  • Other... Please describe:

Description

How to reproduce the issue or how to test the changes

This fixes Directorist listings CSV export missing directory-specific custom field data on multi-directory sites.

The exporter previously normalized every exported row against a single row shape. On sites where different directories have different fields, fields that only exist in another directory could be dropped from the CSV header and from every exported row, even though the listing meta was saved correctly.

This change builds the export columns from the first-seen union of all exported listing row keys, then normalizes each row against that complete column list. This keeps directory-specific fields available in the generated CSV without changing the value formatting or import behavior.

  1. Use a multi-directory site where listings in one directory have custom fields not present in another directory.
  2. Go to Directorist -> Settings -> Import / Export.
  3. Click Export CSV.
  4. Confirm the generated CSV includes directory-specific fields such as:
    • address
    • custom-date
    • custom-date-2
    • price
    • price_range
    • swbdp_dirlink_type-8
    • custom-checkbox-2
    • custom-checkbox-14
  5. Confirm listings with those fields contain their saved values in the exported CSV.
  6. Confirm checkbox values still round-trip through the existing importer as arrays, not literal strings.

Local verification was completed on the migrated support site by exporting through the real admin UI. The generated CSV contained 21 listing rows and included the previously missing Catalogo directory fields and values.

Any linked issues

Screenshot

Checklist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant