Impossible to submit listing when listing category is not created

Describe the issue in as much detail as possible. Please remove the sections below if the issue is obvious enough and doesn’t require extra details.

Steps to reproduce

  1. Precondition - no listing category is created. (1. As an admin remove all categories. )
  2. Login as a user from frontend
  3. Add new listing
  4. Fill in the details
  5. Hit the “Submit” button

Actual result

Details disappear (except of images) and Listing is not submitted.

Expected result

Listing should be added successfully.

Extra details

Tested on Safari, Chrome, web and mobile

Hello. It is normal that a category must be created before the user can add a listing. Because in the search form, if the listing is not linked to a category, the owner’s listing will not appear in the search results.

Thanks. Thus, there shall be some information that category must be created beforehand. Currently it’s confusing.

Hi,

Please clarify — do you mean when categories are not necessary for the site and they aren’t used?

If so, thank you for reporting the issue. As a temporary fix, please use this code snippet to make the category field not required: How to add custom code snippets - HivePress Help Center

add_filter(
	'hivepress/v1/models/listing',
	function ( $model ) {
		$model['fields']['categories']['required'] = false;

		return $model;
	},
	1000
);

Hope this helps