phacility/phabricator · error · Exception
No more than 7 columns per view.
Error message
No more than 7 columns per view.
What it means
AphrontMultiColumnView styles columns with per-count CSS classes ('...-N-up'), and fluid mode (setFluidLayout(true) or setFluidishLayout(true)) only has CSS definitions up to seven columns (see upstream T4054). render() therefore enforces the cap: a fluid multi-column view with more than 7 columns throws. Fixed-width layouts are not subject to this check.
Source
Thrown at src/view/layout/AphrontMultiColumnView.php:70
return $this;
}
public function setBorder($border) {
$this->border = $border;
return $this;
}
public function render() {
require_celerity_resource('aphront-multi-column-view-css');
$classes = array();
$classes[] = 'aphront-multi-column-inner';
$classes[] = 'grouped';
if ($this->fluidishLayout || $this->fluidLayout) {
// we only support seven columns for now for fluid views; see T4054
if (count($this->columns) > 7) {
throw new Exception(pht('No more than 7 columns per view.'));
}
}
$classes[] = 'aphront-multi-column-'.count($this->columns).'-up';
$columns = array();
$i = 0;
foreach ($this->columns as $column_data) {
$column_class = array('aphront-multi-column-column');
if ($this->gutter) {
$column_class[] = $this->gutter;
}
$outer_class = array('aphront-multi-column-column-outer');
if (++$i === count($this->columns)) {
$column_class[] = 'aphront-multi-column-column-last';
$outer_class[] = 'aphront-multi-colum-column-outer-last';
}
$column = $column_data['column'];View on GitHub (pinned to 5720a38cfe)
Solutions
- Reduce the view to at most 7 columns: slice the data, group items, or paginate.
- Or keep the layout fixed-width (remove the fluid/fluidish setters), which does not enforce the cap.
- For larger counts, split the items into several stacked AphrontMultiColumnView rows or use a different layout primitive.
Example fix
// before
$view = id(new AphrontMultiColumnView())
->setFluidishLayout(true);
foreach ($items as $item) {
$view->addColumn($item); // throws once an 8th column is added
}
// after: chunk into rows of at most 7 columns
$out = array();
foreach (array_chunk($items, 7) as $row_items) {
$row = id(new AphrontMultiColumnView())->setFluidishLayout(true);
foreach ($row_items as $item) {
$row->addColumn($item);
}
$out[] = $row;
} Defensive patterns
Strategy: validation
Validate before calling
$rows = (count($columns) > 7)
? array_chunk($columns, 7)
: array($columns);
foreach ($rows as $row_columns) {
$view = id(new AphrontMultiColumnView())->setFluidishLayout(true);
foreach ($row_columns as $column) {
$view->addColumn($column);
}
$out[] = $view;
} Prevention
- Hard-cap columns at 7 whenever fluid or fluidish mode is enabled.
- Turn N>7 items into multiple stacked multi-column rows instead of one wide view.
- Remember the check only applies to fluid layouts; fixed layouts bypass it but may look wrong.
When it happens
Trigger: Calling setFluidLayout(true) or setFluidishLayout(true) and then adding 8 or more columns via addColumn() — commonly a loop that adds one column per item without a limit.
Common situations: Dashboard-style custom pages that grow a column per result; turning an existing fixed 8+ column view fluid; dynamically generated column counts from user data.
Related errors
- Unable to find a content column to place the footer inside.
- Service "%s" is unrecognized, restricted, or you do not have
- When creating a new Almanac interface via the Conduit API, y
- Device "%s" is unrecognized, restricted, or you do not have
- Interfaces must have a unique combination of network, device
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/40392d94e8acf8ce.
Report an issue: GitHub.