Skip to content

Sync master from upstream#80

Merged
adi3890 merged 42 commits into
masterfrom
sync/master
Apr 27, 2026
Merged

Sync master from upstream#80
adi3890 merged 42 commits into
masterfrom
sync/master

Conversation

@vanshk141999

Copy link
Copy Markdown
Collaborator

Summary

  • Syncs latest changes from the upstream sureforms repository master branch into the public mirror.
  • Includes 41 commits since last sync (PR Sync master from upstream #61, 2026-04-20), notably:
    • Version bump to 2.8.1
    • Survey Reports menu — fix WP admin notices appearing above the SureForms header on the empty-state page
    • {entry_id} smart tag for emails, confirmations, PDFs, and integrations
    • Dynamic default values for Dropdown and Multi-Choice fields
    • Polish Złoty (PLN) currency added to payments
    • MCP endpoint REST URL localization fix
    • Phone field country flag no longer changes during browser autocomplete
    • Background color now applied correctly in non-iframe editor mode
    • astra-notices bumped to 1.2.1, bsf-analytics to 1.1.26
    • 2.8.1 changelog cleanup (removed Repeater dynamic options bullet that was rolled back)
    • i18n translation updates

Test plan

  • Verify the diff matches the upstream master branch
  • Confirm no private/sensitive files are included

rahulvarma722 and others added 30 commits April 15, 2026 10:11
…nput

The intlTelInput library's input handler calls _updateCountryFromNumber()
on every input event, which auto-detects the country code and changes
the flag. This causes the flag to jump around when browser autocomplete
fills the field or when the user edits/removes the country code.

Override _updateCountryFromNumber to a no-op after initialization so
the flag only changes when the user explicitly picks a country from the
dropdown (_selectListItem -> _setCountry bypasses this method).

Fixes #2598

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Pass `shouldIframe` prop to StyleSettings and use it to resolve the
correct root element. When the editor is not in iframe mode, query
`.editor-styles-wrapper` from `iframeBody` so style overrides target
the right container.

Fixes #2567

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add URL parameter and smart tag based pre-selection for single-select
dropdown and multi-choice fields. Users can set a Dynamic Default Value
using smart tags like {get_input:param} to pre-select an option based
on URL query parameters (e.g., ?service=development).

- Add dynamicDefaultValue attribute to dropdown and multichoice block.json
- Add Dynamic Default Value control in editor (visible only in single select mode)
- Process smart tags on frontend to resolve and match option labels
- Clear dynamic default when switching to multi-select mode

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add test coverage for dynamic default value in dropdown and multi-choice
fields. Tests cover GET param preselection, case-insensitive matching,
no-match scenarios, multi-select mode guard, static preselection
override, and empty dynamic default preservation.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Cast dynamicDefaultValue to string before passing to process_smart_tags()
  to satisfy PHPStan level 9 type checking
- Move test_resolve_dynamic_default() into existing test-dropdown-markup.php
  and test-multichoice-markup.php per linting convention
- Remove standalone test files

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When a field block (e.g., dropdown, multi-choice) is placed inside a
repeater, the field's `slug` attribute gets prefixed with the parent
repeater's slug (e.g., `srfm-repeater-srfm-dropdown` instead of
`dropdown`). This caused the `srfm_field_options` filter consumers to
fail block-type identification since they relied on `$attributes['slug']`
matching the block type name.

This change injects the block type slug (`$this->slug`) into a dedicated
`block_args` key before passing the attributes to the filter, giving
filter consumers a reliable way to identify the block type regardless of
nesting context.

Fixes brainstormforce/sureforms#2639

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Coordinated bump of both vendored libraries:

- astra-notices 1.1.14 -> 1.2.1 (brainstormforce/astra-notices#87):
  - main file renamed class-astra-notices.php -> class-bsf-admin-notices.php
  - class renamed Astra_Notices -> BSF_Admin_Notices with class_alias BC
  - dual-emits legacy astra_notice_* hooks alongside new bsf_admin_notice_*
- bsf-analytics 1.1.25 -> 1.1.26 (brainstormforce/bsf-analytics#95):
  - switches internal call sites to BSF_Admin_Notices and bsf_admin_notice_*
  - class_exists guard keeps older consumers fatal-free

Consumer edits are limited to the two class-load guards forced by the
upstream file rename (admin/admin.php, admin/analytics.php). Existing
Astra_Notices:: usages and astra_notice_after_markup_* hook listeners
continue to work via the alias + dual-emit contract.
…ces-1.2.1-bsf-analytics-1.1.26

chore: update astra-notices to 1.2.1 and bsf-analytics to 1.1.26
…d integrations

- Register {entry_id} in Smart_Tags::smart_tag_list() so it appears in the editor tag picker
- Handle {entry_id} in smart_tags_callback() reading from $form_data or $submission_data
- Move send_email() to after Entries::add() so entry ID is available at send time
- Inject $form_data['entry_id'] before confirmation, redirect, and email processing

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The tag resolves after Entries::add() — it has no value at form render
time, so it cannot be used in Default Value fields or other pre-submission
contexts. Surface this in the editor smart tag picker to prevent confusion.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Removing from smart_tag_list() hides it from all block editor tag pickers
(including Default Value fields) since it cannot resolve before submission.

Adding it as a hardcoded exception in the is_valid_tag check ensures it
is still processed correctly in email templates, confirmation messages,
redirect URLs, and other post-submission contexts where it has a value.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…exception

Filtering {entry_id} from only the Default Value picker (not email/confirmation)
requires JS changes — both pickers share the same smart_tags_array source.
Reverting to a clean state: {entry_id} appears in all editor dropdowns and
is processed correctly in all post-submission contexts.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The '{current_page_url}' case statement was indented with 2 tabs instead
of 3, causing PHPCS (Generic.WhiteSpace.ScopeIndent.IncorrectExact) and
PHP Insights (PSR2.ControlStructures.SwitchDeclaration.BreakIndent) to
fail in the Code Analysis check.
…add() fails

Revert the send_email() relocation. Keeping the pre-existing call before
the GDPR branch preserves the existing behavior where admin notifications
fire even if Entries::add() returns falsy.

{entry_id} continues to resolve in the confirmation message, redirect URL,
and downstream integrations (PDF, webhook) via the $form_data['entry_id']
injection after Entries::add(). In email bodies it now resolves to '' —
consistent with the GDPR do-not-store path and safer than the prior
behavior change.
…-value-choice-fields

Feature: Dynamic default value for dropdown and multi-choice fields
…lete-change

Fix: Prevent phone field country flag from changing on autocomplete
…or-non-iframe-editor

Fix: Background color not applied in non-iframe editor mode
…s-repeater-slug

Fix: Dynamic options not working for dropdown/multi-choice inside repeater
The MCP settings page built the endpoint URL by concatenating
`srfm_admin.site_url` with `/wp-json/sureforms/v1/mcp`. That string
is incorrect on sites using Plain permalinks (which need
`?rest_route=/sureforms/v1/mcp`), sites with a custom REST prefix via
the `rest_url_prefix` filter, or other non-standard REST routing.

- admin/admin.php: add `mcp_endpoint_url` to the srfm_admin
  localization, computed with `esc_url_raw( rest_url( 'sureforms/v1/mcp' ) )`.
- src/admin/settings/pages/MCP.js: consume `srfm_admin.mcp_endpoint_url`
  instead of hand-building the path.
…nt-url

fix: localize MCP endpoint REST URL via rest_url()
vanshk141999 and others added 12 commits April 24, 2026 16:14
Auto-generated by /i18n command on PR #2670
…2.8.1

Remove Repeater dynamic options bullet from 2.8.1 changelog
Removes leaked internal artifacts that have no value on the public WordPress.org-facing mirror:

- .claude/ (Claude Code harness)
- .scripts/git-hooks/ (developer-machine pre-commit hook)
- internal-docs/ (internal team wiki)
- CLAUDE.md, ARCHITECTURE.md, COMPREHENSIVE_ANALYSIS.md, PRODUCT_ANALYSIS.md, TECHNICAL_OVERVIEW.md (AI-generated internal docs)
- .github/workflows/{push-to-deploy,push-asset-readme-update,release-tag-draft,update-translations,release-pr-template}.yml (internal release/SVN automation referencing org secrets)
- bin/{build-zip.sh,checkout-and-build,i18n.sh} (internal build/CI helpers)

Kept on public:
- .wordpress-org/ (standard WP plugin convention)
- Contributor-facing CI (code-analysis, phpunit, test-coverage-check, playwright, insights)
- docs/ (public developer documentation)
- bin/install-wp-tests.sh and bin/check-test-coverage.sh (used by kept CI workflows)
@adi3890 adi3890 merged commit 5408950 into master Apr 27, 2026
6 checks passed
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.

6 participants