Listing Express Entities for searchable content fails

php8.1, concrete 9.2.0

I have the following code in a blockController:

    public function view() {

      $jobOfferings = \Helpers\JobHelper::getAllJobOfferings();
      $this->set('jobOfferings', $jobOfferings);

    public function getSearchableContent()
      $list = \Helpers\JobHelper::getAllJobOfferings();


The view is all good. ExpressEntries are displayed. When i run the ReIndex Content Task, i get no list of expressEntries. The first line in


fails with:

“Could not convert database value to ‘object’ as an error was triggered by the unserialization: ‘Failed to save key “Concrete__Core__Entity__Attribute__Set__CLASSMETADATA__” of type Doctrine\ORM\Mapping\ClassMetadata.’”

So i do not know what is the difference here and why i can’t get any entries when indexing.

Any Help? thanks

getSearchableContent needs to return a string of content to use for indexing purposes.
You may need to loop through the results of getAllJobOfferings, build up a string of data of the jobs, and return that.

Thanks for answering.

Yeah, i know that and that is what i am trying to do.

But as stated above, the getting of express entities fails with the mentioned error.

Sorry, I didn’t quite read your post correctly.

Not sure I can suggest anything further, but I guess I find it a little odd it talks about failing to save something… when I would expect a ‘get’ to only be reading records.

So what’s happening in the view is not the same as what’s happening in that getSearchableContent function, in that yeah you’re setting the $jobOfferings and $list values to the same thing, but then getSearchableContent() is trying to do something with the value of $list that’s causing problems, which you’re probably not doing in the View (looks like some sort of unserialization that’s failing).

I’d jump over to the core methods where getSearchableContent is processed and do some step by step debugging to see if maybe there’s something weird in your values that’s upsetting it or essentially just seeing if you can isolate exactly where it’s failing and what value it’s processing when it does.