Skip to content

Editing existing records in a module fails to load #2623

Closed Answered by adam-jones-net
adam-jones-net asked this question in Q&A
Discussion options

You must be logged in to vote

I resolved this, it was due to a function I was calling in the controller for my module failing.

So for the record, I am using transformIndexItems() to create a new alias column in the listing page for this module which is a truncated version of an answer field which normally contains long values. I now use the Laravel Str::limit() to truncate the actual answer field and all is fine.

protected function transformIndexItems($items){
      foreach ($items as $item) {
          // copy simplification
          $item->answer_alias='<span class="font12">'.\Str::limit(strip_tags($item->answer),250).'</span>';
      }
      return $items;
  }

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by adam-jones-net
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant