Files
homeproz/db_content_updates/2026-01-12_22-37_property-inquiry-form-reorder.md
T
root b6df4dbb92 Snapshot: MLS sync fixes, image refresh, plugin/theme updates
MLS plugin fixes from this session:
- Fix silent insert failures: location column NOT NULL was rejecting wpdb->insert calls,
  causing ~18k new properties since Dec 2025 to be lost. Inserts now build raw SQL
  with ST_PointFromText so the spatial column is populated atomically.
- Auto-refresh expired media URLs in MLS_Media_Handler::fetch_and_cache(), guarded by
  a property-level GET_LOCK so concurrent fetches share one API refresh.
- Normalize WP_Error to null in mls_get_property_image() so callers can rely on the
  documented string|null contract.
- Support comma-separated property_type filters in MLS_Query and MLS_Cluster so the
  homepage "View All Commercial" link (?property_type=Commercial+Sale,Land,Farm)
  actually filters correctly.
- Incremental sync now looks back 10 minutes past the latest modification timestamp
  as a safety margin against missed records.
- Smart sync exits silently (info-level, not warning) when a full sync is in progress.

Operational:
- New cron: weekly full sync Sundays at 3 AM (/usr/local/bin/mls-full-sync).
- New cron: hourly 2GB cap on mls-thumbnails/ and cache/transformed-images/
  (/usr/local/bin/mls-image-cache-cap).
- Logrotate config for wp-content/debug.log (2-day retention, daily rotation,
  delaycompress).

Repo policy:
- CLAUDE.md updated with explicit "commit everything except build artifacts" policy.
- .gitignore: untrack runtime image caches and debug.log rotations.

Other modifications in this snapshot are pre-existing in-flight theme/plugin/db_content_updates work.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-29 15:32:23 +00:00

3.8 KiB
Executable File

Property Inquiry Form Field Reorder

Date: 2026-01-12 Purpose: Reorder Contact Form 7 "Property Inquiry Form" fields so Additional Comments appears after Name/Email/Phone Status: Applied to dev on 2026-01-12

Background

The property inquiry form should have this field order:

  1. Your Inquiry (readonly display message)
  2. Your Name
  3. Email / Phone (side by side)
  4. Additional Comments
  5. Submit button

Previously, Additional Comments was above the contact fields.

Changes Required

  1. Go to WP Admin > Contact > Forms
  2. Edit "Property Inquiry Form"
  3. Reorder the form fields as shown below
  4. Save the form

New Form Structure

<div class="form-group">
    <label>Your Inquiry</label>
    <div class="readonly-message-display readonly-message"></div>
</div>

[hidden listing-key]
[hidden listing-id]
[hidden property-address]
[hidden property-price]
[hidden property-url]
[hidden default-message]
[hidden agent-email]
[hidden agent-name]

<div class="form-row">
    <div class="form-group">
        <label>Your Name <span class="required">*</span></label>
        [text* your-name]
    </div>
</div>

<div class="form-row form-row-2col">
    <div class="form-group">
        <label>Email <span class="required">*</span></label>
        [email* your-email]
    </div>
    <div class="form-group">
        <label>Phone <span class="required">*</span></label>
        [tel* your-phone]
    </div>
</div>

<div class="form-group">
    <label>Additional Comments</label>
    [textarea comments placeholder "Any specific questions or information you'd like to know..."]
</div>

[submit class:btn class:btn-primary class:btn-lg "Send Inquiry"]

Via SQL (Alternative)

Important: CF7 stores the form structure in wp_postmeta._form, not wp_posts.post_content.

First, find the form ID:

SELECT ID, post_title FROM wp_posts
WHERE post_type = 'wpcf7_contact_form'
AND post_title = 'Property Inquiry Form';
-- Result: ID = 156 (in dev)

Then update the _form meta with the new form structure:

UPDATE wp_postmeta
SET meta_value = '<div class="form-group">
    <label>Your Inquiry</label>
    <div class="readonly-message-display readonly-message"></div>
</div>

[hidden listing-key]
[hidden listing-id]
[hidden property-address]
[hidden property-price]
[hidden property-url]
[hidden default-message]
[hidden agent-email]
[hidden agent-name]

<div class="form-row">
    <div class="form-group">
        <label>Your Name <span class="required">*</span></label>
        [text* your-name]
    </div>
</div>

<div class="form-row form-row-2col">
    <div class="form-group">
        <label>Email <span class="required">*</span></label>
        [email* your-email]
    </div>
    <div class="form-group">
        <label>Phone <span class="required">*</span></label>
        [tel* your-phone]
    </div>
</div>

<div class="form-group">
    <label>Additional Comments</label>
    [textarea comments placeholder "Any specific questions or information you would like to know..."]
</div>

[submit class:btn class:btn-primary class:btn-lg "Send Inquiry"]'
WHERE post_id = (SELECT ID FROM wp_posts WHERE post_type = 'wpcf7_contact_form' AND post_title = 'Property Inquiry Form')
AND meta_key = '_form';

The following theme files were also updated to support this change:

  • page-property-inquiry.php - Updated fallback form field order, added agent lookup, split display vs submission messages
  • inc/wpcf7-hooks.php - Updated HomeProz listing detection to use office name
  • template-parts/property/property-agent.php - Updated to use listing key for inquiry URL

Why

  • Better UX: Users should enter their contact info before typing additional comments
  • The display message shown to users no longer includes MLS# (cleaner)
  • The submitted message includes MLS#, property URL, and user comments for agent reference