Blog Sections Open

Fixing KCFinder File Links That Resolve to undefined/files/

Why TinyMCE and KCFinder can generate broken file URLs like undefined/files and what path assumption is usually wrong.

When the file browser starts inserting links like undefined/files/index.html, the editor is usually not the real problem. The issue is almost always a missing or broken base path assumption inside the KCFinder or TinyMCE integration.

This tends to happen when the file browser cannot resolve the correct upload root and falls back to a value that was never initialized properly.

What to check first

  • the configured upload URL and file URL,
  • base path values in the file browser configuration,
  • whether the editor and file browser expect the same root folder,
  • any environment change such as subfolder installs or moved assets paths.

As soon as one path becomes undefined, the generated file link becomes useless even if the file browser still opens. This is why path configuration should always be audited as a set, not file by file.

Broken link generation in KCFinder is usually a configuration mismatch, not an upload failure.

Newer post

Fixing TinyMCE When It Starts Inserting 4p> Instead of Paragraph Tags

How to reason about strange TinyMCE output corruption when paragraph tags are replaced with broken markup fragments.

Older post

Handling Upgrade Compatibility Issues from Evolution 1.0.5–1.0.12 to 1.0.14

How to approach the messy compatibility layer that appears after moving several older Evolution sites onto the 1.0.14 line.