Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

Can't clear values from organization address #8313

@MarkusHolstein

Description

@MarkusHolstein
Q A
Sulu Version 2.6.14
PHP Version 8.3

Actual Behavior

If you want to clear the latitude/longitude value from the organization address, this is not possible. After saving, the old value is still stored in the organization.

Expected Behavior

When clearing an input field in the organization and saving it, the value should be updated to an empty value.

Steps to Reproduce

  • Open Organization admin
  • Fill in some address-fields in the overlay like lat/lng
  • Save & refresh
  • Remove content from the input fields in the address like lat/lng
  • Save & refresh
  • The old values are still there

Possible Solutions

In AbstractContactManager::updateAddress() there are multiple if clauses using isset($entry[$fieldname]).
As the frontend sends a null value instead of an empty string, if the field is empty. The isset check returns false in this this case and does not override the old value.
This could be solved in two ways:

  • Frontend: send an empty string to the backend
  • Backend: exchanging isset with array_key_exists

If you would like it to be solved via backend, I could do it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugError or unexpected behavior of already existing functionality

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions