MagicMirrorOrg/MagicMirror · warning

[calendar] Deprecation warning: Please consider upgrading yo

Error message

[calendar] Deprecation warning: Please consider upgrading your calendar titleReplace configuration to customEvents.

What it means

The calendar module historically supported a `titleReplace` config array of [search, replace] pairs for rewriting event titles. This was superseded by the more general `customEvents` option. If titleReplace is defined, the module logs this deprecation warning and converts each entry into a customEvents entry (keyword ".*", transform {search, replace}) so old configs keep working.

Source

Thrown at defaultmodules/calendar/calendar.js:161

			if (calendar.user && calendar.pass) {
				Log.warn("[calendar] Deprecation warning: Please update your calendar authentication configuration.");
				Log.warn("https://docs.magicmirror.builders/modules/calendar.html#configuration-options");
				calendar.auth = {
					user: calendar.user,
					pass: calendar.pass
				};
			}

			/*
			 * tell helper to start a fetcher for this calendar
			 * fetcher till cycle
			 */
			this.addCalendar(calendar.url, calendar.auth, calendarConfig);
		});

		// for backward compatibility titleReplace
		if (typeof this.config.titleReplace !== "undefined") {
			Log.warn("[calendar] Deprecation warning: Please consider upgrading your calendar titleReplace configuration to customEvents.");
			for (const [titlesearchstr, titlereplacestr] of Object.entries(this.config.titleReplace)) {
				this.config.customEvents.push({ keyword: ".*", transform: { search: titlesearchstr, replace: titlereplacestr } });
			}
		}

		this.selfUpdate();
	},

	notificationReceived (notification, payload) {
		if (notification === "FETCH_CALENDAR") {
			this.sendSocketNotification(notification, { url: payload.url, id: this.identifier });
		}
	},

	// Override socket notification handler.
	socketNotificationReceived (notification, payload) {

		if (this.identifier !== payload.id) {

View on GitHub (pinned to 4b4a59534f)

Solutions

  1. Migrate each titleReplace pair to customEvents: { keyword: ".*", transform: { search, replace } }
  2. If titleReplace was an array of pairs, note customEvents is an array of objects — restructure accordingly
  3. Use the opportunity to use more specific keywords than ".*" so only matching titles are transformed
  4. Remove the titleReplace key after migration to silence the warning

Example fix

// before
config: { titleReplace: { "Birthday: ": "" } }
// after
config: { customEvents: [ { keyword: ".*", transform: { search: "Birthday: ", replace: "" } } ] }
Defensive patterns

Strategy: validation

Validate before calling

if ("titleReplace" in calendarConfig) {
  console.warn("titleReplace is deprecated: migrate to customEvents with keyword/transform");
}

Type guard

function usesDeprecatedTitleReplace(cfg) {
  return typeof cfg === "object" && cfg !== null && "titleReplace" in cfg;
}

Prevention

When it happens

Trigger: The calendar module config defines `titleReplace` (any value, checked via typeof !== "undefined") in config.js, triggering the warning at defaultmodules/calendar/calendar.js:161 in start().

Common situations: Configs hiding keywords like 'Birthday:' or 'Cancelled' from feed titles, written years ago; copied forum snippets using titleReplace; upgrading MagicMirror without reviewing per-module options.

Related errors


AI-assisted analysis of MagicMirrorOrg/MagicMirror@4b4a59534f (2026-08-31). Data as JSON: /api/errors/fab28d85b8a04e08. Report an issue: GitHub.