Jump to content

Is the ?d= parameter really necessary in Pages categories?


Recommended Posts

Hello,

Here in our install we found the following issue.

Because the source code adds the ?d= parameter in $table->baseUrl, navigation links also have this parameter.

For example, for our https://www.clubedohardware.com.br/noticias/armazenamento/ page, the default navigation becomes https://www.clubedohardware.com.br/noticias/armazenamento/page/2/?d=6, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/?d=6 and so on, instead of just https://www.clubedohardware.com.br/noticias/armazenamento/page/2/, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/ etcetera.

To fix this, I had to edit /applications/cms/modules/front/database/category.php and remove the following line:

$table->baseUrl = $table->baseUrl->setQueryString( 'd', \IPS\cms\Databases\Dispatcher::i()->databaseId );

I know we have a very customized Pages configuration here, but I am giving you a heads up to check whether this line should really exist.

Cheers!

Link to comment
Share on other sites

11 hours ago, Gabriel Torres said:

Hello,

Here in our install we found the following issue.

Because the source code adds the ?d= parameter in $table->baseUrl, navigation links also have this parameter.

For example, for our https://www.clubedohardware.com.br/noticias/armazenamento/ page, the default navigation becomes https://www.clubedohardware.com.br/noticias/armazenamento/page/2/?d=6, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/?d=6 and so on, instead of just https://www.clubedohardware.com.br/noticias/armazenamento/page/2/, https://www.clubedohardware.com.br/noticias/armazenamento/page/3/ etcetera.

To fix this, I had to edit /applications/cms/modules/front/database/category.php and remove the following line:

$table->baseUrl = $table->baseUrl->setQueryString( 'd', \IPS\cms\Databases\Dispatcher::i()->databaseId );

I know we have a very customized Pages configuration here, but I am giving you a heads up to check whether this line should really exist.

Cheers!

This is used to load the form when the database isn't set on a page, @Gabriel Torres:

	/**
	 * Show the pre add record form. This is used when no category is set.
	 *
	 * @return	void
	 */
	protected function form()
	{
		...

		}
		else if ( \IPS\cms\Pages\Page::$currentPage === NULL and \IPS\cms\Databases\Dispatcher::i()->databaseId === NULL and isset( \IPS\Request::i()->d ) )
		{
			\IPS\cms\Pages\Page::$currentPage = \IPS\cms\Pages\Page::loadByDatabaseId( \IPS\Request::i()->d );
		}

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...