I want to display a list of terms and child terms using Taxonomy menu,my list is very large ( more than 2000 terms), and Im getting this error:  Additional uncaught exception thrown while handling exception. Original  PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT * FROM {system} WHERE type = &amp;#039;theme&amp;#039; OR (type = &amp;#039;module&amp;#039; AND status = 1) ORDER BY weight ASC, name ASC; Array ( ) in system_list() (line 165 of C:\wamp\www\Books\includes\module.inc). Additional  PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT expire, value FROM {semaphore} WHERE name = :name; Array ( [:name] =&amp;gt; theme_registry:runtime:adaptivetheme_admin:cache ) in lock_may_be_available() (line 167 of C:\wamp\www\Books\includes\lock.inc). Uncaught exception thrown in session handler.  PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away in _drupal_session_write() (line 206 of C:\wamp\www\Books\includes\session.inc). Uncaught exception thrown in shutdown function.  PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: DELETE FROM {semaphore} WHERE (value = :db_condition_placeholder_0) ; Array ( [:db_condition_placeholder_0] =&amp;gt; 14337154844f4e188d884c54.86419408 ) in lock_release_all() (line 269 of C:\wamp\www\Books\includes\lock.inc).   Is this because Taxonomy menu can not handle a large amount of terms?
1833
Recently I started getting an error every time I try and add a content no matter what type.  This is the error that shows up in the browser:     Additional uncaught exception thrown while handling exception.        Original   PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] =&gt; 0 ) in comment_count_unpublished() (line 313 of /Applications/MAMP/htdocs/modules/comment/comment.module).        Additional      PDOException: SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: INSERT INTO {watchdog} (uid, type, message, variables, severity, link, location, referer, hostname, timestamp) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9); Array ( [:db_insert_placeholder_0] =&gt; 1 [:db_insert_placeholder_1] =&gt; php [:db_insert_placeholder_2] =&gt; %type: !message in %function (line %line of %file). [:db_insert_placeholder_3] =&gt; a:6:{s:5:&quot;%type&quot;;s:12:&quot;PDOException&quot;;s:8:&quot;!message&quot;;s:154:&quot;SQLSTATE[HY000]: General error: 2006 MySQL server has gone away: SELECT COUNT(cid) FROM {comment} WHERE status = :status; Array ( [:status] =&amp;gt; 0 ) &quot;;s:9:&quot;%function&quot;;s:27:&quot;comment_count_unpublished()&quot;;s:5:&quot;%file&quot;;s:56:&quot;/Applications/MAMP/htdocs/modules/comment/comment.module&quot;;s:5:&quot;%line&quot;;i:313;s:14:&quot;severity_level&quot;;i:3;} [:db_insert_placeholder_4] =&gt; 3 [:db_insert_placeholder_5] =&gt; [:db_insert_placeholder_6] =&gt; ; [:db_insert_placeholder_7] =&gt;  [:db_insert_placeholder_8] =&gt; 127.0.0.1 [:db_insert_placeholder_9] =&gt; 1338336955 ) in dblog_watchdog() (line 154 of /Applications/MAMP/htdocs/modules/dblog/dblog.module).   I also get the following error in my php error file:     PHP Fatal error:  Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 2006 MySQL server has gone away' in /Applications/MAMP/htdocs/includes/database/database.inc:2136        Stack trace:   0 /Applications/MAMP/htdocs/includes/database/database.inc(2136): PDOStatement->execute(Array)   1 /Applications/MAMP/htdocs/includes/database/database.inc(664): DatabaseStatementBase->execute(Array, Array)   2 /Applications/MAMP/htdocs/includes/database/database.inc(2315): DatabaseConnection->query('SELECT expire, ...', Array, Array)   3 /Applications/MAMP/htdocs/includes/lock.inc(167): db_query('SELECT expire, ...', Array)   4 /Applications/MAMP/htdocs/includes/lock.inc(146): lock_may_be_available('theme_registry:...')   5 /Applications/MAMP/htdocs/includes/theme.inc(447): lock_acquire('theme_registry:...')   6 /Applications/MAMP/htdocs/includes/bootstrap.inc(427): ThemeRegistry->set(Array)   7 [internal function]: DrupalCacheArray->__destruct()   8 {main}         thrown in /Applications/MAMP/htdocs/includes/database/database.inc on line 2136   I am having a little trouble deciphering these error messages. Could anyone help me understand what's going on here?
11903
I'm currently working on a WordPress site and whenever in the admin I go the Appearance > Menus page I get the following error:     ErrorException: Runtime Notice: Declaration of Walker_Nav_Menu_Edit::start_lvl() should be compatible with that of Walker_Nav_Menu::start_lvl() in wp-admin/includes/nav-menu.php line 203   It seems like some sort of PHP compatibility issue. I'm running PHP 5.3.10 on my local dev machine.  What would be the best way to remedy this problem?
77839
when I try to run the code below I am getting this error: 'Too many DML rows: 10001'. The object that I am trying to update is one of the main object in the org. so it has multiples triggers, workflows, etc. and one API that runs all day long. I am trying to update 29000 records. can anybody please tell me why i am getting this error or if something is wrong with the code. I will appreciate any help!  Class code:     public class updateNRProdObject{    public Decimal Debug{ get; set; }         public void updateObject(){     List&lt;NRProducts__c&gt; products = [SELECT id  FROM NRProducts__c WHERE  Active__c = true];   Debug = products.size();    for(NRProducts__c p : products){       p.Active__c=false;    }    update products ;   } }
45672
This question has been asked before, but none of the answers on those threads have helped so far.  Getting the following error when trying to deploy a test class from the sandbox to production in the Force.com IDE:  System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, LeadPerson: execution of AfterInsert caused by: System.Exception: Too many SOQL queries: 101  LeadPerson trigger looks OK, e.g., no SOQL calls inside a loop.  trigger LeadPerson on Lead (after insert) {     Map&lt;Id, Lead&gt; leadMap = new Map&lt;Id, Lead&gt;();     Map&lt;String, Lead&gt; leadEmailMap = new Map&lt;String, Lead&gt;();      for(Lead lead : Trigger.new) {         if (lead.Email != null) {             leadMap.put(lead.Id, lead);             leadEmailMap.put(lead.Email, lead);         }     }      Map&lt;String, Person__c&gt; personMap = new Map&lt;String, Person__c&gt;();     for (Person__c p : [SELECT Id, Email__c FROM Person__c WHERE Email__c IN :leadEmailMap.keySet()]) {         personMap.put(p.Email__c, p);     }      List&lt;Person__c&gt; addPersons = new List&lt;Person__c&gt;();     List&lt;PersonHistory__c&gt; addPersonHistorys = new List&lt;PersonHistory__c&gt;();     List&lt;Lead&gt; addPersonLead = new List&lt;Lead&gt;();     Map&lt;String, String&gt; addPersonEmails = new Map&lt;String, String&gt;();      for(Lead lead : Trigger.new) {         if (lead.Email != null) {             if (personMap.containsKey(lead.Email)) {                 // Create PersonHistory__c record for existing Person__c records                 Person__c getPerson = personMap.get(lead.Email);                 PersonHistory__c newPersonHistory = new PersonHistory__c();                 newPersonHistory.Person__c = getPerson.Id;                 newPersonHistory.RecType__c = 'LEAD';                 newPersonHistory.RecSubType__c = lead.inq_type__c;                 newPersonHistory.SFID__c = lead.Id;                 newPersonHistory.RecTypeStatus__c = 'NEW';                 addPersonHistorys.add(newPersonHistory);             } else {                 // Create Person__c and PersonHistory__c record for NEW Person__c records                 String firstInitial = '';                 if (lead.FirstName != null) {                     firstInitial = lead.FirstName.substring(0, 1);                 }                  if (!addPersonEmails.containsKey(lead.Email)) {                     addPersonEmails.put(lead.Email, 'EMAIL');                     Person__c newPerson = new Person__c();                     newPerson.Email__c = lead.Email;                     newPerson.AltKey__c = firstInitial + lead.LastName + lead.PostalCode;                     newPerson.Current_Status__c = 'NEW';                     addPersons.add(newPerson);                     addPersonLead.add(lead);                 }             }         }     }      // INSERT NEW Person__c records     List&lt;Database.SaveResult&gt; newPersonResult = Database.Insert(addPersons);     for (integer i = 0; i &lt; newPersonResult.size(); i++) {         // Create PersonHistory__c records for new Person__c records         PersonHistory__c newPersonHistory = new PersonHistory__c();         newPersonHistory.Person__c = newPersonResult.get(i).getId();         newPersonHistory.RecType__c = 'LEAD';         newPersonHistory.RecSubType__c = addPersonLead.get(i).inq_type__c;         newPersonHistory.SFID__c = addPersonLead.get(i).Id;         newPersonHistory.RecTypeStatus__c = 'NEW';         addPersonHistorys.add(newPersonHistory);     }     insert addPersonHistorys; }   The debug log doesn't show a transaction having more than 5 out of 100 SOQL queries in the CUMULATIVE_LIMIT_USAGE sections. Not sure where to look next. Any help is appreciated.
14443
The Unhandled Exception's name is cut off in this  and in the answer too. The last 'n' looks like an 'r'.  Using Firefox 3.6.6.  Examples:
44861
The title says it all. At the moment in my custom taxonomies I'm getting the terms using the term id and taxonomy name.  Thought this question would've been asked before but can't find it anywhere! So just thought I'd ask and see if anyone has any answers.
51345
The MySQL manual at  covers this.  Usually I just dump the database and reimport it with a new name. This is not an option for very big databases. Apparently RENAME {DATABASE | SCHEMA} db_name TO new_db_name; .  This needs to work with , which stores things very differently than .
16437
I'm trying to show terms of custom taxonomies. I have that. But, my problem is how to separate when I have multiple terms. My code:  &lt;ul class="slides"&gt;     &lt;?php $loop = new WP_Query( array( 'post_type' =&gt; 'member', 'posts_per_page' =&gt; -1 ) ); ?&gt;     &lt;?php while ( $loop-&gt;have_posts() ) : $loop-&gt;the_post(); $do_not_duplicate = $post-&gt;ID; ?&gt;         &lt;li&gt;             &lt;h2&gt;&lt;?php $terms = get_terms('department');                 foreach ( $terms as $term ) {                     echo $term-&gt;name.' and ';                 }             ?&gt;&lt;/h2&gt;             &lt;?php the_post_thumbnail('full'); ?&gt;             &lt;div class="caption"&gt;                 &lt;h4&gt;&lt;?php the_title(); ?&gt;&lt;/h4&gt;                 &lt;h5&gt;&lt;?php $terms = get_terms('position');                     foreach ( $terms as $term ) {                         echo $term-&gt;name.' and ';                     }                 ?&gt;&lt;/h5&gt;                 &lt;?php the_content(); ?&gt;                 &lt;a href="&lt;?php the_permalink(); ?&gt;"&gt;See Full Biography&lt;/a&gt;             &lt;/div&gt;         &lt;/li&gt;     &lt;?php endwhile; wp_reset_query(); wp_reset_postdata(); ?&gt; &lt;/ul&gt;   With this I am able to display all terms used (good). But, I need it to say "and" only between terms. Right now, it says "and" after every term, even it's only one term. I know my problem lies within here:  &lt;?php $terms = get_terms('department');     foreach ( $terms as $term ) {         echo $term-&gt;name.' and ';     } ?&gt;   How do I only get the "and" to only show between terms and not after every term?
74320
Over at , there is overlapping text in the Database Schema under Close-As-Off-Topic-Reason-Types:  that makes it really hard to read.  This is also happening underneath &quot;Pending Flags&quot;, and seemingly with every long line in the schema.  This would be fine if you could increase the width of the list as you can with the height, which would in theory separate the lines, but you can't.  Can we fix this, please?  UPDATE: I have found that  post is almost exactly the same as mine, but steady on with duplicate votes.   comment says that it will be fixed, but that question was asked more than five years ago, and in that time the problem has not been resolved.  UPDATE 2: It seems that  would help.  I changed a little CSS/HTML, and came up with this:  Although mine is a little cruder than it could be.  This is just an example.
116216
I used this      $this-&gt;termStorage-&gt;loadByProperties(['name' =&gt; 'test']);   I got two terms: Test, test. I want to get only one: test  This is working without case-sensitive:       $this-&gt;termStorage-&gt;getQuery()-&gt;condition('name', 'test', '=')-&gt;execute();       \Drupal::database()-&gt;select('taxonomy_term_field_data', 't')       -&gt;condition('t.name', 'test')       -&gt;fields('t', ['name'])       -&gt;execute()       -&gt;fetchAll();       \Drupal::database()-&gt;query("SELECT name FROM taxonomy_term_field_data WHERE name='test'")-&gt;fetchAll();
43143
I am using ubercart guest checkout module. I am able to submit  the order as guest etc works fine.   After Reviewing the order and submitting it throws me this error   Recoverable fatal error: Argument 2 passed to db_query() must be an array, string given, called in /var/www/html/dev.demo.net/sites/all/modules/ubercart_guest_checkout/uc_guest_checkout.module on line 263 and defined in db_query() (line 2342 of /var/www/html/dev.demo.net/includes/database/database.inc).   This is the query which is causing that issue    db_query('UPDATE {users} SET name = "%s", mail = "%s" WHERE uid = %d', $name, $mail, $account-&gt;uid);   I tried to change this query like this  db_update('users') -&gt;fields(array(     'name' =&gt; $name,     'mail' =&gt; $mail )) -&gt;condition('uid',$account-&gt;uid,'=')        -&gt;execute();   still no luck, it throws me same above specified error.    How can i resolve the query of above one in order to avoid the error. Any suggestions w.r.t query will be nice.Thanks in advance.
12219
I recently migrated an old server running MySQL to a new VPS running MariaDB 5.5. I don't have too much running on the server (just a few PHP sites) and free memory seems to be OK, but the DB keeps crashing--sometimes every few days, other times within a few hours.  I receive the following errors in the logs:  131231  1:43:04 [ERROR] mysqld: Out of memory (Needed 128917504 bytes) 131231  1:43:04 [ERROR] mysqld: Out of memory (Needed 96681984 bytes) 131231  1:43:04 [ERROR] mysqld: Out of memory (Needed 72499200 bytes) 131231  1:43:04 [ERROR] mysqld: Out of memory (Needed 54362112 bytes) 131231  1:43:04 InnoDB: The InnoDB memory heap is disabled 131231  1:43:04 InnoDB: Mutexes and rw_locks use GCC atomic builtins 131231  1:43:04 InnoDB: Compressed tables use zlib 1.2.3.4 131231  1:43:04 InnoDB: Using Linux native AIO 131231  1:43:04 InnoDB: Initializing buffer pool, size = 128.0M InnoDB: mmap(137756672 bytes) failed; errno 12 131231  1:43:04 InnoDB: Completed initialization of buffer pool 131231  1:43:04 InnoDB: Fatal error: cannot allocate memory for the buffer pool 131231  1:43:04 [ERROR] Plugin 'InnoDB' init function returned error. 131231  1:43:04 [ERROR] Plugin 'InnoDB' registration as a STORAGE ENGINE failed. 131231  1:43:04 [Note] Plugin 'FEEDBACK' is disabled. 131231  1:43:04 [ERROR] Unknown/unsupported storage engine: InnoDB 131231  1:43:04 [ERROR] Aborting  131231  1:43:04 [Note] /usr/sbin/mysqld: Shutdown complete   I've played with the my.cnf settings for InnoDB Heap, which does not seem to help. Here's the relevant portion:  innodb_buffer_pool_size = 128M innodb_log_buffer_size  = 8M innodb_file_per_table   = 1 innodb_open_files       = 400 innodb_io_capacity      = 400 innodb_flush_method     = O_DIRECT   I seem to have "plenty" of free RAM, and I have some swap available as well:  root@phoenix:~# free -m              total       used       free     shared    buffers     cached Mem:           994        923         71          0         19        417 -/+ buffers/cache:        486        508 Swap:         1023        131        892   How can I solve / troubleshoot this issue? I've scoured the interwebz for clues, but nothing has helped.
104197
When i create new User Account and login with that credentials, it gives me this problem if admin doesnt have set thier values yet !!!**  AllotmentList = [select id, Days_Remaining__c from PTO_Allotment__c where Year__c =:year and Employee__c=:EmployeeList[0].id LIMIT 100]; //access only Current user Allotment details                 //to handle Listoutof Bound Exception wrote if-else          if(AllotmentList.size()&gt;0)         {         requests.PTO_Allotment__c=AllotmentList[0].id;         requests.Days_Remaining__c=AllotmentList[0].Days_Remaining__c;         }         else         {             //write a code when AllotmentList is empty ....         }
24825
I have inherited a client site that has an extremely large database for no reason. There is a moderate amount of content and very little enabled modules. However, the database is too large for moving around easily and I want to clean it out.  I have cleared out the standard cache tables, syslog and accesslog.  Are there any other tables I can safely truncate in a standard Drupal site?
86157
I was trying to add the column of MYSQL Timestamp to the Database Table, the Query seems to be working correctly in mysql console.But when I execute the same in db_query() the following error is thrown.     Failed: PDOException: SQLSTATE[42000]: Syntax error or access   violation: 1067 Invalid default value for 'last_update_date': ALTER   TABLE stores ADD last_update_date TIMESTAMP NOT NULL DEFAULT   '0000-00-00 00:00:00';; Array ( ) in store_update_7100() (line 254 of   /var/www/slocamo_app/sites/all/modules/store/store.install).   Is the Query.  ALTER TABLE  `stores` ADD  `last_update_date` TIMESTAMP NOT NULL DEFAULT  '0000-00-00 00:00:00');
103941
I have a "term reference" field, in a form that uses an auto-complete widget. I want to limit user input to terms in the vocabulary only, and output a message when a user tries to enter a non existing term.  I found the  module. However this does not work with forms that contain a field collection or a field group.  There is also a contributed patch . But I was wondering whether there was a simpler/cleaner solution like a module or maybe I missed an already existing way of doing it with latest drupal and taxonomy versions.
117690
I'm really struggling to add a taxonomy_term as an entity reference to a custom entity I've created programmatically.  Here is my configuration based on BaseFieldDefinition (the name of the vocabulary is "specialite":  $fields['speciality_field'] = BaseFieldDefinition::create('entity_reference')   -&gt;setLabel(t('speciality'))   -&gt;setRevisionable(TRUE)   -&gt;setSetting('target_type', 'taxonomy_term')   &gt;setSetting('handler_settings', ['target_bundles' =&gt; ['specialite' =&gt; 'specialite']])   -&gt;setSetting('handler', 'default')   -&gt;setTranslatable(TRUE)   -&gt;setDisplayOptions('view', array(     'label' =&gt; 'hidden',     'type' =&gt; 'author',     'weight' =&gt; 0,   ))   -&gt;setDisplayOptions('form', array(     'type' =&gt; 'entity_reference_autocomplete',     'weight' =&gt; 5,     'settings' =&gt; array(       'match_operator' =&gt; 'CONTAINS',       'size' =&gt; '10',       'autocomplete_type' =&gt; 'tags',       'placeholder' =&gt; '',     ),   ))   -&gt;setDisplayConfigurable('form', TRUE)   -&gt;setDisplayConfigurable('view', TRUE);   This piece of code doesn't work, would you please help to find what I am missing, or redirect me to a good documentation explaining different values for handler_settings  Thank you so much.