Looking for pointers on fixing this error:
TypeError: Argument 2 passed to SelectQuery::fields() must be of the type array, null given, called in /home/hkdemos0/public_html/npp/includes/entity.inc on line 317 in SelectQuery->fields() (line 1316 of /home/hkdemos0/public_html/npp/includes/database/select.inc).

I'm attempting to create a dev site for an existing D7 that I did not build. I am an admin on the existing site but do not have access to the server .

Here's what I did so far:
1) Used Backup and Migrate module to create and download database backup from the production site
2) Did a fresh install of the same D7 version on my server at http://hkdemos.com/npp/, creating a new MySQL database in the process
3) Deleted the settings.php file from my sites/default folder, leaving only the default.settings.php
4) Installed Backup and Migrate on my http://hkdemos.com/npp/ site and used it to import the database from step #1 above
5) Installed missing contrib modules (this part was a little strange- Drush said they were already there but in order to get the site to recognize them I had to manually copy over the module directories from the archive created in step #1 above into the dev site's sites/all/modules directory)
6) Installed theme

Everything seemed to fine until I added a basic page on the dev site. Then the site returned the error. I've looked at the entity.inc and select.inc files but I'm not sure what to do.

line 317 in entity.inc is $query->fields('base', $entity_fields);

line 1316 in select.inc is public function fields($table_alias, array $fields = array()) {

Comments

VM’s picture

the error indicates where the death occurs not where the symptoms begin. Are you using the rules module? if yes, what version? Also what version of PHP is in use?

Anonymous’s picture

Thanks for the reply.
Not using Rules module.
Using PHP 5.4.45

VM’s picture

suggest working through similar reports of the error via the following results https://www.google.com/search?q=TypeError%3A+Argument+2+passed+to+Select...()+must+be+of+the+type+array%2C+null+given%2C+called+in&rlz=1C1CHBF_enUS714US714&oq=TypeError%3A+Argument+2+passed+to+SelectQuery%3A%3Afields()+must+be+of+the+type+array%2C+null+given%2C+called+in&aqs=chrome..69i57j69i58.526j0j7&sourceid=chrome&ie=UTF-8