User name not shown [[*publishedby:userinfo=`fullname`]]

Sure, I’ve read it of course. I’m just a bit frustrated with MODX that there are so many small issues taking days to resolve, getting referred to Github, etc. (with a great community that is helpful), whilst other CMS’s just deal with it properly.

This is a pretty common experience for users of any CMS, imo. That’s why this forum is exists.

It’s also kind of inevitable for any CMS that records who published a page. When the user is removed, there’s really no sensible way to deal with the “published by” record for pages that the user published, though adding the publishedby field to the Create/Edit Resource panel would help a lot when trying to fix the problem.

There are several ways to fix the problem, but editing the DB is probably the easiest.

Here’s another way. It edits the DB with a snippet. Just put the snippet tag on a new page with this content:

[[!FixPublishedBy]]

Then, create a snippet named FixPublishedBy with this code:

/* FixPublishedBy snippet */

/* replace the 00 with the ID of the problem page 
    (found in parentheses after the page title in the Resource Tree). */
$pageId = 00;  

/* replace the 00 with the ID of the user you want to show 
    (see Manage -> Users). */
$newId = 00; 

$doc = $modx->getObject('modResource', $pageId);
if ($doc) {
      $doc->set('publishedby', $newId);
      $doc->save();
      return "publishedby field updated";
} else {
      return "Could not find page with ID:" . $pageId;
}

View the page.

1 Like

Is there a value for the field “Full name” defined for this user? (Maybe this field is just empty and that’s why you don’t see an output.)

I just want a functioning CMS...