Attribute Key changing value

I can’t figure out where this value is store. There is an Attribute key in Express Data objects; “What is the value of six plus 9 ?” Where is the value of the answer to that answer (currently 15) stored at. I can’t find anywhere how to change it. Sorry. This is probably a pretty silly question but I’ve been struggling with this for more than an hour. I want to change that question to something different and that means changing the answer key.
Thanks

This sounds like it could be custom code. I’d check for the handle of that attribute key and try to search for that string in the application folder which might reveal a file containing some logic handling the response.

I thought it would be stored in the database so I looked there. The handle is what_is_the_result_of_six_plus_9 I searched (grep) the whole concrete directory and nothing. I then searched the database for that handle and the only place it exists is in AttributeKeys. But the value (15) is not in AttributeKeys. I know it must be someplace because if I use it as a question on a form then the form fails with anything other than 15.
Someone must know where that 15 is stored. I kinda have to wonder why someone would create this field and then not give a way to change it ???

The value is an AttributeValue and is referenced to the AttributeKey by its ID. It looks like someone built a Math Captcha while using the Express Functionality…

1 Like

Ok, that I already knew. How can I change the value?

Is the value stored in the code, the database, or a file? I’m not a programmer so it’s not easy for me to find this stuff. I can do some stuff but I’ve searched everywhere for where the result might be stored. I have a need to use this and it’s just sitting there available to me but I just need to be able to change that result to a different number. I am surprises it’s so difficult that nobody knows. Someone building concretecms put it there, so someone must know how to change it.

The value is stored in the database but should be accessible through UI. Go to system & settings → Express Objects and find the entries to that attribute.

But there should be Tables “atNumber” (for Integer Values) and “atDefault” (for String Values) in your database and I assume you’ll find the 15 in one of those two tables and referenced to by the AttributeValueID (avID) which is connected to your AttributeKeyID (akID) in the table “AttributeValues”.

But it shouldnt really need digging or changing in the database.

There is no way to change the number in the system UI
Also atNumber does have a 15 but it is the number that was entered when the form is submitted, not the number checked against.

Follow the “View Contact Entries” Link and check there. It might be that you have to adjust the “Customize Search/Listing” to make the fields visible that you need.

All in all, I do not think that Express is an elegant way to produce a match captcha…

I’m not sure how following “View Contact Entries” is supposed to help. There is nothing in there that suggests anything about the issue I’m having.
I’m pretty much giving up on this. Disappointed to say the least. Concrete is so easy to use on one hand and then on the other it’s just impossible for an end user to understand. There does not seem too be a way to change and then test against this value. If it’s not useable then it should be cleaned out of the code.

It looks to me that it is not possible to use an Express attribute to test a value. It looks like it’s just a way to add a value to the form but not to test that value. I’d need to code to do this. Is that true?

Attributes are used to ask users the values of something, as well as to set the properties of users, pages, and so on.
Then it’s up to some code to process those attributes.

Concrete already has zillions of lines of code to handle the default attributes. But of course it’s impossible to foresee all the cases users may need.

In your specific case, it seems you want to check if users answer correctly to a question. And this specific case is not handled by Concrete out of the box: you need a custom attribute type, which requires some coding skills.

1 Like

That all makes sense, but let’s be clear about one thing. This attribute is “out of the box” I did not create this attribute. It’s built into concrete. So naturally I assumed that if there was an attribute built in and it was a question, that there was also a built in way to check the answer to the question.

The attributes you can assign to a form are only used to collect data.
What users do with the collected data is up to the users.

Sure. I understand that. But when ConcreteCMS packages something like the attribute in question it give the distinct impression that someplace there was code to deal with it.
So basically what’s happened is the developers put in a question for a captcha but never wrote code to deal with what they created.

It’s you that are giving the question the “it’s a captcha” meaning: developers only allows you to ask anything.
Again: standard attributes are only meant to ask users to enter some data, nothing more.

And about your captcha requirements: concrete supports captchas. There’s one already bundled in the core, but there are also others - see https://market.concretecms.com/products?keywords=captcha

Umm, no I did not say it was a captcha.

@baxterdmutt, let’s start from the beginning. I feel like there are some misunderstandings here, so I’m going to try to summarize some of the information already given to see if we can pinpoint the confusion.

First, everything Express-related should be editable through the dashboard. If you are dealing with something that is 100% Express, there’s no need to edit the database directly because Express is an interface for the database.

There are two places to interact with Express. First is is the sort of data view at Dashboard > Express > <name of express object>. Based on your screenshot, the express object is probably named “Contact”. This area is generally used for interacting with the data that has been stored in the Express data object, like the rows in a database table.

The second place to look is the settings view in Dashboard > System & Settings > Express > Data Objects and then selecting the Express object, which again is probably “Contact”. This area will lead to the screenshot you posted. This area is generally used for configuring and editing the Express data object (similar to ALTER TABLE commands in SQL). You can define attributes (like fields of a database) as well as define forms which are used for data entry.

Based on your screenshot, the attribute type is Number. So, unlike an option list, there is not a pool of numbers to choose from; the form associated with this attribute is basically like a text field with some validation to ensure that the the input is numeric. The only values associated with this attribute are going to be in the data that has been stored against it (rows of a database table). You can view these values in the first area described above, or from the second area by selecting “View Contact Entries” (which is kind of a shortcut to the first area).

Within the database, numeric attribute values are going to be stored in their own table called atNumber. But again, there should be no reason to look in the database unless you are dealing with some custom code.

That’s it for Express. It’s just an ORM that can be built out through the backend UI.

However, based on what you have wrote, it sounds like you are using some custom code that is using Express as the database. This is a normal use case for Express, but it’s up to the developer to make it useable.

There are two places where the custom code might live. The first is in the application/ directory. This directory is for customizing a website and is adjacent to the concrete/ directory. The second place is in the packages/ directory. Custom code also lives here, but it’s more self-contained so that it can be more easily installed on other sites.

Within those two areas may be some custom code that’s using the attribute you are looking for. The way to access Express attributes uses magic methods like this:

$contact = Express::getEntry(1); // or whatever ID is used for the entry
$contact->getWhatIsTheResultOfSixPlus9();

I think there may be a way to get the attribute by a getByHandle() method, but the magic method route is more common.

So that’s where and how you can look. I’m guessing that whoever built this custom code might have also stored the answers in Express too, so you might look around for other Express objects as well. But I agree with what others have wrote - this is most likely some custom code that is using Express, so changing how it works is going to require figuring out that code.

1 Like