Skip to content
View in the app

A better way to browse. Learn more.

ernestdefoe.online

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
ernestdefoe.online

Extensions, themes & support for Flarum and Invision Community

Vibe coding for the community web. Report a bug, request a feature, or dig into the source — this is where the tools you use get built, in the open.

We do custom Bespoke Invision Community apps. If you have an idea for something you want then use the contact form to get in touch with us.
Knowledge base

Things that cost me a day, so they cost you none

Working notes from building Invision Community and Flarum applications. Mostly the failures that give no error at all — the ones where everything installs cleanly and quietly does the wrong thing.

92 articles

Invision Community 5

86 articles

Extensions and contracts

39

What each extension point is for, what it must declare, and what happens when it is wrong — which is usually nothing visible.

Languages and text

5

The string table, translation, and the places where text does not appear where you expected it to.

Theming, templates and forms

9

Theme hooks, CSS that survives both colour schemes, and building forms that do not throw on render.

Background work and scheduled tasks

5

The queue system, work that has to happen after the response, and jobs that finish without doing anything.

Data, settings and storage

11

The database layer, settings, tags, file storage, and backing up a live site.

AI features and expectations

5

What these features do, what they cost, and what buyers reasonably but wrongly assume they do.

Application structure and releases

11

The JSON files an application is made of, versioning and upgrade steps, and testing from the command line.

Realtime, chat and calls

1

WebSocket gateways, relays and the server-side pieces live features depend on — where "it works when I test it" and "it works for your members" are different claims.

Nothing matches that.

A malformed manifest silently disables your whole application

An application whose listeners.json or extensions.json does not parse installs perfectly, shows its AdminCP screens, saves its settings — and never runs a single line of its own automation. There is no error, no log entry, and nothing in the interface that looks wrong.

The cause

Core reads both manifests the same way, inside an and chain, with the warning suppressed:

if ( file_exists( $jsonFile ) and $json = @json_decode( file_get_contents( $jsonFile ), TRUE ) )
{
    foreach( $json as $filename => $data )
    {
        // ... register
    }
}

A malformed file makes json_decode() return NULL. The and short-circuits, the loop never runs, and the method returns an empty array. The @ hides the only clue there would otherwise be.

The application is still enabled. Its tables exist. Its ACP module works. It simply contributes no listeners and no extensions.

The usual cause: a single backslash

These manifests are full of namespaced class names, and JSON has no \e, \M or \n-that-you-meant escape.

// INVALID - \e and \l and \M are not JSON escapes
"classname": "IPS\myapp\listeners\MemberEvents"

// CORRECT
"classname": "IPS\\myapp\\listeners\\MemberEvents"

Both look reasonable in an editor. Only one parses.

Worse, a single backslash before certain letters produces a valid escape that silently corrupts the value rather than failing outright. "IPS\nexus\\Invoice\\Item" parses cleanly and yields a string containing a literal newline followed by exus\Invoice\Item. The manifest loads, the class name is nonsense, and class_exists() quietly returns false.

The second silent failure: a class that is not there

Even with valid JSON, core checks before registering:

if( file_exists( $directory . '/' . $filename . '.php' ) )
{
    if( class_exists( $data['classname'] ) )
    {
        $listeners[] = $data['classname'];
    }
}

Declare something you never wrote — easy to do when a manifest is created during scaffolding and the class comes later, or never — and it is skipped without a word.

How to detect it

Neither failure is visible at runtime, so check the files themselves. Two passes: does every manifest parse, and does every declared class have a file?

foreach ( glob( $root . '/*/data/*.json' ) as $file )
{
    $raw = file_get_contents( $file );

    if ( trim( $raw ) === '' ) { continue; }

    json_decode( $raw, TRUE );

    if ( json_last_error() !== JSON_ERROR_NONE )
    {
        echo 'BROKEN ' . $file . ' - ' . json_last_error_msg() . PHP_EOL;
    }
}

Then, for each entry in listeners.json, confirm listeners/<key>.php exists; for each entry in extensions.json, confirm extensions/<app>/<type>/<key>.php exists. The key in the manifest is the filename.

Confirming it at runtime

If you suspect an application is contributing nothing, ask core directly rather than reading the file:

foreach ( \IPS\Application::enabledApplications() as $dir => $app )
{
    foreach ( (array) $app->listeners() as $class )
    {
        echo $dir . ' :: ' . $class . PHP_EOL;
    }
}

foreach ( \IPS\Application::allExtensions( 'core', 'Loader' ) as $key => $ext )
{
    echo $key . PHP_EOL;
}

An application missing from that output has a manifest problem, whatever the file looks like. Clear the datastore first, since extension lists are cached.

Why this is worth a standing check

Every other mistake in an application announces itself somewhere — a fatal, a missing language string, a blank block. This one produces an application that is perfectly plausible and does nothing, and the natural response is to go and debug the code that was never invoked. Validating the manifests takes a second and rules it out for good.

Verified against

Invision Community 5.0.19, by reading Application::listeners() and Application::extensions() in system/Application/Application.php, and by shipping an application that had this exact fault.


User Feedback

Recommended Comments

There are no comments to display.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.