Project

General

Profile

Actions

Bug #87689

closed

Different behavior with different database drivers

Added by Dirk Heyka almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Must have
Category:
SEO
Target version:
-
Start date:
2019-02-11
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I found a bug in the EXT:seo. When I use the database-driver pdo_mysql all resulted fields will be strings. I found this error while I was trying to make a sitemap.xml with more sitemaps (for an own extension e.g.).

So I debugged in RecordsXmlSitemapDataProvider->generateItems and there were all fields strings (uid, pid, tstamp, crdate, etc.).

When I change the database-driver to mysqli everything works fine and all said fields have the right types (here int)
The type/default value for uid, pid, tstamp, crdate, etc. fields in the tx_products_domain_model_product table is integer.

The TypoScript for the Sitemap:

plugin.tx_seo {
    config {
        xmlSitemap {
            sitemaps {
                products {
                    provider = TYPO3\CMS\Seo\XmlSitemap\RecordsXmlSitemapDataProvider
                    config {
                        table = tx_products_domain_model_product
                        sortField = title
                        lastModifiedField = tstamp
                        pid = 2
                        recursive = 2
                        url {
                            pageId = 4
                            fieldToParameterMap {
                                uid = tx_products_products[product]
                            }
                            additionalGetParameters {
                                tx_products_products.controller = Product
                                tx_products_products.action = show
                            }
                            useCacheHash = 1
                        }
                    }
                }
            }
        }
    }
}

The Sitemap-Config:

routeEnhancers:
  PageTypeSuffix:
    type: PageType
    map:
       sitemap.xml: 1533906435

When I use pdo_mysql, I'll become an error-message: TypeError: Return value of TYPO3\CMS\Seo\XmlSitemap\AbstractXmlSitemapDataProvider::getLastModified() must be of the type integer, string returned.

Debug with pdo_mysql driver:
Debug with pdo_mysql driver

Debug with mysqli driver:
Debug with mysqli driver

P.S. I discussed that problem with Richard Haeser before. He said, that I should assign this ticket to him.


Files

mysqli.png (54.4 KB) mysqli.png Debug with mysqli driver Dirk Heyka, 2019-02-11 15:00
debug_pdo.png (74.3 KB) debug_pdo.png Debug with pdo_mysql driver Dirk Heyka, 2019-02-11 15:00
Actions

Also available in: Atom PDF