Issue Bug Closed

#87689Different behavior with different database drivers

Dirk Heyka 02/11/19, 15:07 updated 05/07/19, 12:13

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_pdo.png

*Debug with mysqli driver:*
mysqli.png

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

Reviews 2