I have field final result on which on certain values, I only want some of the users to make the changes. The problem is that the user Id which are not mentioned in the formulae are able to get the error message which is correct but those users which are mentioned in the users Id are also not able to change the values which is incorrect. I only want the users mentioned in the formulae to edit the values.Basically I want that if the final result has values (ACCEPTED,REJECTED,ACCEPTED-Team Foundation",the users mentioned in the formuale can change to next stage,rest not.  The formula is :   AND(NOT(OR(ISPICKVAL(Final_Result__c,"ACCEPTED"),ISPICKVAL(Final_Result__c,"REJECTED"),ISPICKVAL(Final_Result__c,"Accepted-Team Foundation"))),OR(($User.Username &lt;&gt; "005j000000CNXpO"),($User.Username &lt;&gt; "005j000000DM7GK"),($User.Username &lt;&gt; "005j000000DY8DN"),($User.Username &lt;&gt; "005j000000C04vl"),($User.Username &lt;&gt; "005j000000CO3h7"),($User.Username &lt;&gt; "005j000000C0BeQ"),($User.Username &lt;&gt; "005j000000CO3gi"),($User.Username &lt;&gt; "005j000000CO3hC"),($User.Username &lt;&gt; "005j000000CO3iP"),($User.Username &lt;&gt; "005j000000D4hiP")))
60644
I have a requirement where a certain field can be edited without the validations firing for a particular user. Now I tried to write rule like LastModifiedId != '005000000000000AAA' but the validation was still firing. Then I realized that until the record saves, the LastModifiedId does not change and the validations still fire, as the LastModifiedId would not be updated to the exempted User.   Is there any workaround or a way to check the Id of the User who is currently editing the record?
96090
I am having a picklist field which has 3 values 1.Web, 2.Mail, 3.Other.If i select other then the text must be editiable. If i select web or mail then the textbox must in uneditiable mode. Kindly tell how to do this.Im using PE
119111
I am creating a Formula field that returns texts when:   Picklist_Status = Activated, the return text should be A else null Picklist_Status = Sold, the return should be B else null Picklist_Status = ChangeofMind , the return should be C else null   So these are 2 picklist fields that would update the formula field if a OR b OR C is true.   My FORMULA:  OR ( IF ( ISPICKVAL ( Status__c , 'Verified Complete' ), 'B' , IF ( ISPICKVAL ( OHSI_Status__c , 'Ok for Production' ), 'B+' , IF ( ISPICKVAL ( OHSI_Status__c , 'Activate' ), 'A' 'null' ))))   Error: Incorrect parameter type for function 'OR()'. Expected Boolean, received Text  I do not know where to put the OR.. these 3 should be OR
92037
I want to programatically alter a message in the message queue. The message I want to alter is set in the message queue by function comment_form_submit() in comment.module, i.e.:  if ($comment-&gt;status == COMMENT_NOT_PUBLISHED) {   if (!user_access('administer comments')) {     drupal_set_message(t('Your comment has been queued for review by site administrators and will be published after approval.'));   } }   Instead of this, I want the call to drupal_set_message() to be this:  drupal_set_message(t('Your comment will be published when you validate your e-mail address.'));   How do I do this?  Postscript: Based on the answer below by Topsitemakers, I got this working for any language by using array_search() inside a custom MYMODULE_comment_submit to search the message array, and then compare the translated strings to identify the key of the string to alter.  This is the working code I ended up with:  $mm = drupal_get_messages('status', TRUE); $key = array_search(t('Your comment has been queued for review by site administrators and will be published after approval.'), $mm['status']); if (FALSE !== $key) {   $mm['status'][$key] = t('Your comment will be published when you validate your e-mail address.'); } foreach ($mm['status'] as $msg) {   drupal_set_message($msg, 'status'); }
45827
I have the following validation rule:  AND(  $Profile.Name &lt;&gt; 'System Administrator',  OR(  ISPICKVAL(PRIORVALUE(Level__c), "Archived"),  ISPICKVAL(PRIORVALUE(Level__c), "Closed")  )  )   This validation rule is on the opportunity object, and what I want to achieve is, if the picklist Level__c is either set to Archived or Closed, the opportunity record can only be edited by the System Administrator.  For some reason though, the validation rule also triggers, when I want to set the Level__c to Archived or Closed. But this is not what I want.   Any idea what's wrong with the validation rule?
18957
I have read this post  about how to use field_attach_update to save nodes without the overhead of node_save().  I would like to use this for users (which it should work for, as per ) . However, I'm not sure how to apply the examples to users.  Currently, this is my code:  if (isset($uid)) {     $user = user_load($uid);     $user_og_groups = $user-&gt;og_user_node[LANGUAGE_NONE];     $user_committee_positions = $user-&gt;field_committee_position_serno[LANGUAGE_NONE];     $user_data = my_module_import_user($cust_info, $cust_attributes, $drupal_countries, $employers);     $user = user_save($user, $user_data);   }   The $user_data variable is an array of data, which is what user_save expects (). user_save() doesn't work exactly the same as node_save() and doesn't accept a user object.  How then can I use field_attach_update to programmatically update users?
18415
I wonder if this feature is available in TeX system? For example, given a formula within a table, it can apply the formula and display data after the calculation.
96449
I am trying to create a formula that will put a 1 in a hidden field if the value of a picklist is equal to a specific value.  I keep getting stuck here and I can't figure out what I am missing?  IF(ISPICKVAL( Examiner_Type__c ="Pending Examiner Status","1","",))
73
If user input is inserted without modification into an SQL query, then the application becomes vulnerable to , like in the following example:  $unsafe_variable = $_POST['user_input'];   mysql_query("INSERT INTO `table` (`column`) VALUES ('$unsafe_variable')");   That's because the user can input something like value'); DROP TABLE table;--, and the query becomes:  INSERT INTO `table` (`column`) VALUES('value'); DROP TABLE table;--')   What can be done to prevent this from happening?
34252
I want to validate the field for US format phone number(478-857-4578). I used the below code, it works fine for all but one scenario.  If I enter only 4 digit number or below than, the error message     The validation formula has evaluated to an error   is displayed.   But for all other wrong inputs, my custom error message     Please enter phone number in 214-587-5485 format   is displayed.  I wanted to display my custom error message for all invalid inputs. Do I need to change anything in formula?  Formula:  =AND( LEN([num])=12,     IF(ISERROR(FIND("-", [num],4)),         FALSE,         (FIND("-", [num], 4) = 4)     ),     IF(ISERROR(FIND("-", [num],8)),         FALSE,         (FIND("-", [num], 8) = 8)     ),     IF(ISERROR(1*CONCATENATE(MID([num], 1, 3), MID([num], 5, 3), MID([num], 9, 4))),         FALSE,         AND(             1*CONCATENATE(MID([num], 1, 3), MID([num], 5, 3), MID([num], 9, 4)) &gt; 1000000000,             1*MID([num], 1, 3) &lt;&gt; 911,             1*MID([num], 5, 3) &lt;&gt; 911         )     ) )
29087
/**  * Implements hook_form_alter().  */ function MODULE_NAME_form_alter(   &amp;$form,   \Drupal\Core\Form\FormStateInterface $form_state,   $form_id ) {    if ($form_id == 'node_article_form') {     $form["body"]["widget"][0]['#allowed_formats'] = ['full_html']; // Your default format     $form["body"]["widget"][0]['#after_build'][] = 'MODULE_NAME_hide_format';   } }  function MODULE_NAME_hide_format(   &amp;$element,   FormStateInterface $form_state ) {   if (isset($element["format"]["format"])) {     $element["format"]["format"]["#access"] = FALSE;   }    return $element; }
38563
I'm trying to create two cells that will update my query: A >= date"A1" and A &lt;= date "B1".  My goal is to create a search page for the data, where the end user could insert a date or the =today() function and it would update the query. I am currently getting a formula parse error from:  =QUERY(Data!6:1397,"SELECT A,B,C,D,E,F,G,H,I,J,K,L WHERE A &gt;= date"A1"and  A &lt;= date"B1"")
80872
I have a custom form that needs to display a default value from a custom user field. The field was created under /admin/config/people/accounts/fields and its machine name is field_r_period_length_sec.  //get user $userCurrent = \Drupal::currentUser(); $uid = $userCurrent-&gt;id(); $r_period = $userCurrent-&gt;field_r_period_length_sec;   However, the value doesn't show and I get this error:     Notice: Undefined property: Drupal\Core\Session\AccountProxy::$field_r_period_length_sec   What am I doing wrong?
123140
I have a textfield autocomplete field that shows a list of full user names and email addresses as designed but when a user is selected, the user id is displayed in the field; not the name and email address.  This is the form element:  $form['people'] = [   '#type' =&gt; 'textfield',   '#placeholder' =&gt; t('Search by name'),   '#autocomplete_route_name' =&gt; 'my_module.people', ];   This is the autocomplete handler in the controller:  public function handleAutocomplete(Request $request) {    $query = $this-&gt;database-&gt;select('simplenews_subscriber', 'ss');   $or = $query-&gt;orConditionGroup()     -&gt;condition('pa.address_given_name', '%' .$request-&gt;query-&gt;get('q') . '%', 'LIKE')     -&gt;condition('pa.address_family_name', '%' .$request-&gt;query-&gt;get('q') . '%', 'LIKE');   $query-&gt;leftJoin('simplenews_subscriber__subscriptions', 'sss', 'sss.entity_id = ss.id');   $query-&gt;leftJoin('profile', 'p', 'p.uid = ss.uid');   $query-&gt;leftJoin('profile__address', 'pa', 'pa.entity_id = p.profile_id');   $query-&gt;fields('ss', ['uid', 'mail']);   $query-&gt;fields('pa', ['address_given_name', 'address_family_name']);   $query-&gt;condition($or);   $query-&gt;orderBy('address_given_name');   $query-&gt;range(0, 10);    $results = $query-&gt;execute()-&gt;fetchAll();    $users = [];    foreach ($results as $user) {     $users[] = [       'value' =&gt; $user-&gt;uid,       'label' =&gt; $user-&gt;address_given_name . ' ' . $user-&gt;address_family_name . ' (' . $user-&gt;mail . ')',     ];   }    return new JsonResponse($users); }   The autocomplete textfield populates properly.  I just want the first name, last name and email address to show after a selection has been made.
99470
What I mean is to change mistakes/typos other than the proposed changes your reviewers pointed out to you.  As this article is based on a previous thesis (which had a very similar focus, only it was oriented towards a different cultural context) I've noticed a few paragraphs that could use a clean up (for example it would help to clarify that I use a certain term because it is related to the administrative divisions in my country,etc.).  I also noticed a typo on one of the results on the table that got carried over to the abstract. It doesn't change the results or findings or anything, basically it's just a decimal that should be lower.  My question is, would it be OK to change them now? And in case it was should I let the reviewers know I cleaned it up or go through each change, besides the ones they asked me to do, obviously.
73499
I have a formula in List settings-&gt; validation settings. The formula validates correctly. The user message  I entered does not display, it displays its own message below which is  Error: The validation formula has evaluated to an error.  How can I show my User message? See a screenshot below:
109351
I just edited  that contained some code that was overall neat and correct, but wouldn't compile. I made it compile clean and (in my opinion) more readable.  The edit got rejected as too minor, because during my edit the OP made the code compile-clean in the grace period and thus in the diff that shows up to the reviewers, only the parts making the code more readable showed up. Such an edit is a too minor one, without question.  In my opinion there are two possibilities to solve this kind of "conflict":   When user A has edited a post and user B (>2k rep, or original author) has edited that post in the meantime user A gets a message that the post has changed and is asked to revise that edit based on the changes made in the meantime. The easier one: Don't allow edit suggestions in the grace period.   I don't care about the missing reputation I would have gotten if the suggestion had been approved. I just don't like my suggestions being reviewed on a false basis - because the diff that is displayed to the approvers does not display the correct edit.  Doing a quick search here on meta I found some questions maybe related to this problem - none of them however addresses the problem of the review based on incorrect diffs: