Changed the temporary PAGE_ID constant to a variable accessible on the ci
object because the constant was throwing "already defined" errors during page duplication.
Fixed a premature redirect during page duplication. Fixes #2188. Closes #2284