Error after importing members

  • I've got a Runway site with Perch Members. I've imported members direct into the database from Excel. Everything appears to be working OK. But when on the "Listing members" page in Perch admin and clicking column headings to sort the list of members, I'm getting this notice displayed above the list of members (this is in my local development site where I display all errors etc):


    Notice: Undefined index: _id in C:\wamp\www\pixel\cms\addons\apps\perch_members\modes\members.list.post.php on line 121


    And in debug (in both development and live sites):

    Array

    (

    [type] => 8

    [message] => Undefined index: _id

    [file] => C:\wamp\www\pixel\cms\addons\apps\perch_members\modes\members.list.post.php

    [line] => 121

    )


    The error is not displayed when sorting by members' email addresses; it only happens when sorting by the "Joined" date or by "Status". Despite the error, the sorting still works correctly.


    This wasn't happening before I imported members from Excel - sorting wasn't producing the error then. So I'm pretty sure it's a problem with how I've imported the data not an issue with Runway or the Perch Members app. I've made no changes to Perch core or Perch Members files.


    I'd be really grateful if someone could point me in the right direction to resolve this in case it affects something else in the future that I haven't tested yet.


    Diagnostics:


    Summary information


    Perch Runway: 3.1.7, PHP: 7.2.0, MySQL: mysqlnd 5.0.12-dev - 20150407 - $Id: b396954eeb2d1d9ed7902b8bae237b287f21ad9e $, with PDO

    Server OS: WINNT, apache2handler

    Installed apps: content (3.1.7), assets (3.1.7), categories (3.1.7), perch_forms (1.12), perch_members (1.6.4), mbk_forms (1.0), pipit (0.6.1), pipit_members (1.3.0)

    App runtimes: <?php $apps_list = [ 'perch_forms', 'mbk_forms', 'perch_members', 'pipit', 'pipit_members', ]; ?>

    PERCH_LOGINPATH: /cms

    PERCH_PATH: C:\wamp\www\pixel\cms

    PERCH_CORE: C:\wamp\www\pixel\cms\core

    PERCH_RESFILEPATH: C:\wamp\www\pixel\cms\resources

    Image manipulation: GD

    PHP limits: Max upload 128M, Max POST 128M, Memory: 1024M, Total max file upload: 128M

    F1: 3b606135b33e6a102526838f4152a807

    Resource folder writeable: Yes

    HTTP_HOST: pixel.local

    DOCUMENT_ROOT: C:/wamp/www/pixel

    REQUEST_URI: /cms/core/settings/diagnostics/

    SCRIPT_NAME: /cms/core/settings/diagnostics/index.php

  • I've never tried importing members into the database but I think the problem is this:


    When a member is created in Perch in the normal way, it generates an _id value. However, your import doesn't do this. I would assume that you don't have this value in your Excel spreadsheet. So, it's undefined according to Perch. That's why you get the message.


    Can you check your database and see if the _id is missing for your imported members?


    As for a solution, it may be possible to import and generate and autoincrement the value but I'm a bit rusty on MYSQL importing and how the _id value is defined in the database so someone else will need to comment here.

  • Hi Clive,

    Thanks for an astoundingly quick response on Good Friday!! Unfortunately, there isn't an "_id" column in the perch3_members table of the database. There is a memberID, which I've populated - along with all the other columns in that table. The database table looks OK.