When I try to open certain channels for editing, I receive the following:
Fatal error: Call to a member function getMemberName() on a non-object in /home/ruralint/public_html/risys/ee/EllisLab/ExpressionEngine/Controller/Publish/Edit.php on line 177
The contents of Edit.php near that section involve the auto-save function. But line 177 seems to stand on its own.
$title .= '
<span class="meta-info">— ' . lang('by') . ': ' . htmlentities($entry->Author->getMemberName(), ENT_QUOTES, 'UTF-8') . ', ' . lang('in') . ': ' . htmlentities($entry->Channel->channel_title, ENT_QUOTES, 'UTF-8') . '</span>';
This is an upgraded version, from 2.7.3. I am concerned about database corruption, but am open to suggestions for investigation.
This copy of the site is not live yet.
[Addendum and partial solution] I had purged all the member names from the Members lists, as we no longer support any services only for those who have created an account. This seems to be what caused the problem. I used the following code, which worked fine for getting rid of all my “Pending” members in ID=4, but using ID=5 and the same code is what apparently broke the Edit.php code.That is - Folks, do not do this!!
DELETE FROM exp_member_data where member_id in (select member_id FROM exp_members where group_id = 5) LIMIT 1000000
DELETE FROM exp_message_folders where member_id in (select member_id FROM exp_members where group_id = 5) LIMIT 1000000
DELETE FROM exp_member_homepage where member_id in (select member_id FROM exp_members where group_id = 5) LIMIT 1000000
DELETE FROM exp_members where group_id = 5 LIMIT 1000000
I did get rid of about 2/3rds of them using the following, which worked fine:
Delete from exp_members where group_id = 5 AND member_id not in (Select member_id From exp_member_data where last_visit > 0)
That left 12,000 I am not certain how to purge safely (thus the partial solution title), but it is far less than we had before! (Almost 48,000!)
Terry
It looks like you have some authors who do not have a member account anymore, but did not get reassigned. Deleting member records manually is highly discouraged, as there are a number of associations you could leave orphaned, which sounds like what has happened here. Do you have a backup you could work from? Your best bet would be to use the bulk action on the form to delete members in bulk.
Derek,
I did have a backup, and restored things to working again - love to do backups!
Ah, yes - that is likely it – orphaned authors (we’ve been at it 10 years, so of course!)
When I took out the ones who had signed up but never returned, nothing got damaged. But that still left 12,000 behind.
Will the bulk form manage to leave old authors alone? (I feel a query that matches author names with member names might be tricky…)
What you mention definitely rules out a simple date-based removal. I guess we’ll have to review our authors and perhaps put them all into a special “retired” membership group, and then attempt weeding after that. (With backups in place, of course!!!)
Terry
If you try to delete members that have records, ExpressionEngine will offer you to reassign them to another member. Entries must have authors, so either the old members need to still exist (even if you remove them from the authorlist), or you will need to reassign those entries to another member.
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.