Support Forums - Classified Ads Script Osclass

General osclass questions => General discussion => Topic started by: sandralina on November 26, 2021, 10:20:20 PM

Title: Someone Help! Custom field works on add new post, and not in item page
Post by: sandralina on November 26, 2021, 10:20:20 PM
Hello everyone,

I have a real estate website and when i try to add a new custom field for example " surface" with a text box. When i add a new listing and fill this new custom field. it doesnt appear in item page and as well in the edit item page it shows an empty box like i didn't fill it during adding a new listing.

Someone can help me with this?
Title: Re: Custom field works on item post, and not in item page
Post by: MB Themes on November 27, 2021, 08:17:04 AM
Try realestate plugin to identify if fields are not stored or just not shown on item page.
This plugin will show some values even you do not enter them at publish page
Title: Re: Custom field works on item post, and not in item page
Post by: sandralina on November 27, 2021, 03:49:51 PM
Try realestate plugin to identify if fields are not stored or just not shown on item page.
This plugin will show some values even you do not enter them at publish page

Thank you for your answer, before that i want to clarify that when i add the value in page of adding a new listing, the result is that the value not shown in the item page, but when i edit the listing inside my oc-admin it can be showed fine in item page.
so the problem is that the custom fiel can be shown fine when i edit the listing but not when i add new listing.
Title: Re: Custom field works on item post, and not in item page
Post by: MB Themes on November 28, 2021, 08:48:05 PM
It is not too clear to me. Send links, logins etc and we can check that how it works.
Title: Re: Custom field works on item post, and not in item page
Post by: sandralina on November 29, 2021, 02:42:07 AM
It is not too clear to me. Send links, logins etc and we can check that how it works.

I will try to explain it with the screen shots bellow:


1- I create a new Custom field with the name " Surface "

(https://i2.paste.pics/e66c59d19849acbdccded174d349b6e2.png?trs=180ae42e61f592f5cb80f69606bfacbdd98105f799022c62ea368c7de3459d59)

2- I added a new listing and filled the new custom field with " Test Text"

(https://i2.paste.pics/ea0ca82cb3499422cd9270b403d0238b.png?trs=180ae42e61f592f5cb80f69606bfacbdd98105f799022c62ea368c7de3459d59)

3- As you can see in item page, the new custom field doesn't appear

(https://i2.paste.pics/599a7af19d8a5258445095a4caede29d.png?trs=180ae42e61f592f5cb80f69606bfacbdd98105f799022c62ea368c7de3459d59)

4- in the listing edit page the Customd field "Surface" is empty as well

(https://i2.paste.pics/447a0991482be75825d813dcebf1aecf.png?trs=180ae42e61f592f5cb80f69606bfacbdd98105f799022c62ea368c7de3459d59)

5- But when i fill the surface custom field in Edit page

(https://i2.paste.pics/b1a70dbb399b91ab949ff94435d48d0f.png?trs=180ae42e61f592f5cb80f69606bfacbdd98105f799022c62ea368c7de3459d59)

6- The result in item page

(https://i2.paste.pics/75dcb05586018e1c32237f21b5ef22d5.png?trs=180ae42e61f592f5cb80f69606bfacbdd98105f799022c62ea368c7de3459d59)

Conclusion: The custom field appears only when editing the post. But when you add a new post, in this case the custom field remain empty

I hope this will help

Title: Re: Custom field works on item post, and not in item page
Post by: sandralina on November 30, 2021, 02:10:24 PM
It is not too clear to me. Send links, logins etc and we can check that how it works.

I hope this will help u to figure out. I'm still waiting help, Thank you
Title: Re: Someone Help! Custom field works on add new post, and not in item page
Post by: MB Themes on November 30, 2021, 07:08:00 PM
@sandralina
This means custom field is not stored when creating new listing.
You should review database logs to check if you are not getting some kind of error there (php erro log may help as well)
Title: Re: Someone Help! Custom field works on add new post, and not in item page
Post by: sandralina on December 01, 2021, 02:35:40 PM
@sandralina
This means custom field is not stored when creating new listing.
You should review database logs to check if you are not getting some kind of error there (php erro log may help as well)

After consulting error_log i found this notice:

PHP Notice:  Undefined index: HTTP_X_FORWARDED_FOR in /home/algeriah/public_html/config.php on line 30

i checked the line 30 in config.php : $_SERVER['HTTP_X_FORWARDED_FOR']

what's that mean? and is it the reason which causes the custom field problem?
Title: Re: Someone Help! Custom field works on add new post, and not in item page
Post by: MB Themes on December 01, 2021, 03:54:13 PM
@sandralina
Does not look to be related to your issue, but not sure what this line is working in config.php
Title: Re: Someone Help! Custom field works on add new post, and not in item page
Post by: sandralina on December 02, 2021, 01:11:58 AM
@sandralina
Does not look to be related to your issue, but not sure what this line is working in config.php

I checked everything, i didn't notice error related to custom field issue. I don't understand why the custom field is not stored when adding a new listing, but it's stored when you edit the listing.
Title: Re: Someone Help! Custom field works on add new post, and not in item page
Post by: sandralina on December 02, 2021, 12:11:35 PM
@frosticek

Hello, I have noticed something, the Custom field works normally when you add a listing with registed account, but it does't work when you add a listing as a guest. How do you think i can fix this? because i allow people to post even when they don't register
Title: Re: Someone Help! Custom field works on add new post, and not in item page
Post by: MB Themes on December 04, 2021, 02:26:49 PM
This does not make much sense as custom fields are connected using item ID not iser ID.
Try to rrinstall your osclass using latest version, I was not able to reproduce your bug.