Project

General

Profile

Actions

Bug #87689

closed

Different behavior with different database drivers

Added by Dirk Heyka about 5 years ago. Updated almost 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 #1

Updated by Gerrit Code Review about 5 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59682

Actions #2

Updated by Gerrit Code Review about 5 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59682

Actions #3

Updated by Gerrit Code Review about 5 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59682

Actions #4

Updated by Gerrit Code Review about 5 years ago

Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/59687

Actions #5

Updated by Richard Haeser about 5 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #6

Updated by Benni Mack almost 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF