Error on Add Listing Page - 'Category' Field Contains Invalid Value"

Hi,

I’m encountering an issue on my add listing page where I receive the error message: “Category” field contains an invalid value. Despite having no categories added, this error persists when trying to submit a listing.

I’ve tried to resolve this issue using the following PHP snippets:

add_filter(
    'hivepress/v1/forms/listing_submit',
    function( $form ) {
        unset($form['fields']['categories']);
        return $form;
    },
    1000
);
add_filter(
    'hivepress/v1/models/listing',
    function( $args ) {
        $args['fields']['categories']['required'] = false;
        return $args;
    },
    1000
);

However, the error message still appears. I’m unsure if there’s a step I’m missing or if there’s another solution I should try.

Any assistance or guidance would be greatly appreciated!

Hi,

Please provide more details regarding this issue (e.g., your actions step by step with screenshots, etc.). This will help us to reproduce and resolve the issue faster. Also, please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.

Hi,

When submitting/creating a listing, an error message appears on screen. I have deleted all categories in the admin panel and can confirm that the category field is not present in the form.

Actions Taken:

  1. Attempted to submit a listing and received an error.
  2. Verified that no categories are created in the admin panel.
  3. Deactivated all third-party plugins and custom code.
  4. Ensured caching is disabled.

Screenshots of the error are attached.

Thanks again! Michelle

Hi,

Please try to delete this attribute and create a new one by changing the Field Name. Because this name, which is shown on the screenshot, most likely conflicts with the name of the category field that already exists in HivePress.

Hi,

Thanks for the reply!

I wanted to clarify that I do not have any attributes, or categories, with the field name ‘Category’ in my HivePress setup. I’ve attached a screenshot that show the current configuration of my attributes.

Could you please advise on any other possible causes or solutions for this issue?

Thanks again! Michelle

Hi,

Please try these three recommendations:

  1. Please disable third-party plugins and customizations (if there are any) and check if this issue persists. If you use a caching plugin, make sure that caching is disabled for logged-in users.

  2. Disable cache in a production environment

  3. Alternatively, try adding any category and then removing it.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.