I'm working on some legacy code to get this Drupal 7 project to run on php7.1. I'm cleaning up some queries to use db_query() to sanitize input and there are some queries that just will not pass in their values. This is an example of one that I cannot see what I'm doing wrong.
I have two fields in a content type. The first is a list of the site's registered users (user entity reference), the second is a textarea. I would want to ensure only referenced user can enter some value into the text in edit mode. Is there a module for this or custome code to achieve this?
The field permission module doesn't suit this as it only support permission for node creation and not editing. Thanks