*

morfik

  • ****
  • 169 posts
I didn't know where to put this because it concerns both the theme and the dashboard, so I decided to put it here.

Basically, in the Delta theme there's a setting that mandates which fields should be filled before publishing an ad. There's the location option, which enables the user to provide one (or more) of the following: country/region/city. So basically when a user posts an ad and provides country, region and city area (instead of city), it will be posted. 

But let's assume, the user made a mistake in the ad, and I (as admin) want to edit the ad from the dashboard. I'm making changes, and now I want to save it. I get an error stating that the city is required. So I can't edit this ad (again as admin) because the field that wasn't required before publication now is required... I had to change the ad via database. Is there some secret option in the core, to make the city optional?  :D

*

LeeNewman

  • **
  • 13 posts
I have a similar problem I think and not sure if it's related. But the member submits a listing with the city selected. But when I approve in admin panel, the city is unselected and I also get the message saying city is required. This doesn't happen from the member account, only from the admin panel. So something not working on the backend.

*

MB Themes

Before submitting new listing in front, check if inputs/select with name fk_i_city_id, s_city are filled or are empty.
Maybe there is just error in front that does not require city as mandatory field.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
But the setting was intentional, i.e. to use localization, which enables users to choose between country, region or city (or any mix of the three + the text field of city area). Basically, users use the city area text field, because their city isn't available on the city list. If I required the city to be filed before posting an ad, they wouldn't be able to post the ad, because their city doesn't exists. So the theme settings seem to work as intended, but in the dashboard it requires to provide city when editing an ad, and the admin is unable to edit the ad because the city doesn't exist. 

*

MB Themes

Could not reproduce.
If no city exists in region, city select box is converted to city input.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
I just want to make sure. If a user types some city, and this city doesn't exist and he hits enter, the entered phrase will be used as the name of the city? So if I entered non-existent-city text, will this be printed in the city field in the item page?

*

MB Themes

@morfik
Correct.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots

*

morfik

  • ****
  • 169 posts
@morfik
Correct.

Wow, I didn't know it, I had to add some hint for this so users sopped using the city area field instead.

But this doesn't solve the issue with empty city in the dash board. I mean it would when I require now the city, but in the case where the city is optional, it still requires the city in the dashboard while editing.

*

LeeNewman

  • **
  • 13 posts
Hi morfik

I found the answer to my issue and i think it will also solve yours, hopefully! Firstly, force your members to use dropdown lists to avoid them from entering anything other than what's already defined. This wasn't required to fix my problem but I think it may help yours. What was causing the City not to appear in the admin panel was to due to a bug with the drop-down list on the backend. So I switched the backend to use the auto-complete instead and now it retains the City field. See this link on how to do these things. Note, I only changed the City options.

https://docs.osclasspoint.com/changing-between-drop-down-and-autocomplete-for-locations
« Last Edit: February 25, 2023, 05:23:16 PM by MB Themes »

*

morfik

  • ****
  • 169 posts
I just want to make sure. If a user types some city, and this city doesn't exist and he hits enter, the entered phrase will be used as the name of the city? So if I entered non-existent-city text, will this be printed in the city field in the item page?

No it doesn't work in this way. When a user enters the city name which doesn't exist, the field will be empty after sending the form. So the admin in dashboard won't be able to edit the listing either...

So the requirement for the city in the dashboard while editing a listing should be removed, or it should depend on whether the city field is required while sending form. One way or another -- the current setup is bugged.