octobercms/october · error · Error

Page Lookup popup option "alias" is not set.

Error message

Page Lookup popup option "alias" is not set.

What it means

Constructor guard in the client-side PageLookupWidget: the data-config passed from PHP omitted the alias option (the AJAX handler alias), so the widget cannot talk to its server counterpart. The PHP widget must render the alias in its configuration.

Solutions

  1. Pass an 'alias' option when initializing the PageLookup popup widget
  2. Check that server-side widget rendering supplies the data-alias attribute
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at modules/cms/widgets/pagelookup/assets/js/pagelookup.js:66 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of octobercms/october@b608633a7e (2026-08-21). Data as JSON: /api/errors/a9f0b83e29638f87. Report an issue: GitHub.

Appendix: source

Thrown at modules/cms/widgets/pagelookup/assets/js/pagelookup.js:66

            const url = el.match(/href="(.*?)"/);
            if (url !== null) {
                const processedUrl = processResolverLink(url[1]);
                htmlText = htmlText.replace(el, el.replace(url[1], processedUrl));
            }
        }
    }
    return htmlText;
}

class PageLookupWidget {
    static proxyCounter = 0;

    constructor(config) {
        this.config = this.getConfig(config);
        this.proxiedMethods = {};

        if (this.config.alias === null) {
            throw new Error('Page Lookup popup option "alias" is not set.');
        }

        this.$rootElement = $('<div />');
        this.$rootElement.one('hide.oc.popup', this.proxy(this.onPopupHidden));
        this.$rootElement.one('shown.oc.popup', this.proxy(this.onPopupShown));

        this.show();
    }

    dispose() {
        for (const key in this.proxiedMethods) {
            this.proxiedMethods[key] = null;
        }

        for (const propertyName of Object.getOwnPropertyNames(this)) {
            this[propertyName] = null;
        }
    }

View on GitHub (pinned to b608633a7e)