Custom entity api admin UI overview table how to add extra columns and operations? Drupal 7 I've seen this: Custom entity operation links but it's for Drupal 8 and dealing with nodes whereas mine is a non-node type entity.

So how does one go about adding stuff to the row? I want to add custom operations and basically get control of it but I can't see where to start.

I've extended EntityDefaultUIController in the conventional way (like this). When you go the administrative UI we can debug and break in entity.ui.inc and see the following code snippets which seems to be where this gets invoked. But I've got a feeling that there's a quicker and easier way than adding extended versions of the already existing EntityDefaultUIController functions. But what holds the operations &amp; additional column row information?

entity.ui.inc

within overviewTable(...) ...

foreach ($entities as $entity) {
  $rows[] = $this-&gt;overviewTableRow($conditions, entity_id($this-&gt;entityType, $entity), $entity);
}


... which leads us to the following function (same file)

protected function overviewTableRow($conditions, $id, $entity, $additional_cols = array()) {


and we get use of $additional_cols in the 4th (0th + 3 in array speak) parameter but as you can see it's not passed as a parameter above so how do you go about getting this additional information added into the overviewTable?

    // Add in any passed additional cols.
    foreach ($additional_cols as $col) {
        $row[] = $col;
    }
I figured out how do do this, and it, of course, isn't terribly straightforward...

You're on the right track, you just need to override the EntityDefaultUIController::overviewTable function in your own custom class. I don't think there's an easier way (since you're looking for one).

So, copy the the implementation of overviewTable from EntityDefaultUIController (in entity/includes/entity.ui.inc in the Entity API module) into your custom ui controller class and look for the calls to:

$this-&gt;overviewTableRow($conditions, entity_id($this-&gt;entityType, $entity), $entity);


...and add the $additional_cols parameter which should be an array populated with the extra data (which you can pull from the $entity object already populated in the foreach loop. So, do something like:

foreach ($entities as $entity) {
  $additional_cols = array($entity-&gt;someField, $entity-&gt;someOtherField);
  $rows[] = $this-&gt;overviewTableRow($conditions, entity_id($this-&gt;entityType, $entity), $entity, $additional_cols);
}


In addition to that you'd have to add the associated headers into the render array at the end of the overviewTable function like so...

$additional_headers = array('some field', 'some other field');

$render = array(
  '#theme' =&gt; 'table',
  '#header' =&gt; $this-&gt;overviewTableHeaders($conditions, $rows, $additional_headers),
  '#rows' =&gt; $rows,
  '#empty' =&gt; t('None.'),
);


...my guess is that you already figured out this much, but to answer your question, no, I don't think that there's an easier way. I hope this helps you, or someone else. ...or if someone knows this easier way, let me know too... =)