Skip to content
Code-Schnipsel Gruppen Projekte

Revisionen vergleichen

Änderungen werden so angezeigt, als ob die Quellrevision mit der Zielrevision zusammengeführt würde. Erfahre mehr über den Vergleich von Revisionen.

Quelle

Zielprojekt auswählen
No results found

Ziel

Zielprojekt auswählen
  • quiqqer/products
1 Ergebnis
Änderungen anzeigen
Commits auf Quelle (4)
  • Henning Leutz's avatar
    fix: update php version and optimize string operations · 2855c70c
    verfasst von Henning Leutz
    Updated the PHP version requirement from 8.0 to 8.1 in composer.json.
    Refactored the string operations functions in category.php and productList.php. Replaced the
    'strpos' function with 'str_contains' for better readability and performance. Also replaced the
    usage of 'strpos' to check for string start with 'str_starts_with' for better readability. Fixed
    some strings formatting.
    2855c70c
  • Henning Leutz's avatar
    fix: improve error logging for product frontend view · b2d08aff
    verfasst von Henning Leutz
    This commit expands on the error handling mechanism in our product model to be more specific during
    logging. If a product is activated in the system but not found in the frontend (HTTP 404 response),
    an error message is now logged using a 'products_not_found' tag. This will make it easier to
    identify and address issues with deactivated products that should be active. This commonly occurs
    when an outdated link through a search engine directs a user to a non-existing product page.
    b2d08aff
  • Henning Leutz's avatar
    Merge branch 'next-2.x' into 'main' · dee89d82
    verfasst von Henning Leutz
    fix: update php version and optimize string operations
    
    See merge request !115
    dee89d82
  • Henning Leutz's avatar
    Merge branch 'main' into 'next-3.x' · 2f9e53c2
    verfasst von Henning Leutz
    Update 'next-3.x' with latest changes from 'main'
    
    See merge request !116
    2f9e53c2
......@@ -16,7 +16,7 @@
"url": "https://www.pcsg.de"
},
"require": {
"php": "^8.0",
"php": "^8.1",
"quiqqer/core": "^2",
"quiqqer/erp": "^3.2",
"quiqqer/areas": "^2",
......
......@@ -351,9 +351,21 @@ public function getViewFrontend(): ViewFrontend
try {
return new ViewFrontend($this);
} catch (\Exception $Exception) {
QUI\System\Log::addError($Exception->getMessage(), [
'extra-message' => 'product frontend view error'
]);
if ($Exception->getCode() === 404) {
// log products not found
// these are often products that are called up but are deactivated and still exist
// e.g. when search engines still direct users to it
QUI\System\Log::addError(
$Exception->getMessage(),
['extra-message' => 'product frontend view error'],
'products_not_found'
);
} else {
QUI\System\Log::addError(
$Exception->getMessage(),
['extra-message' => 'product frontend view error']
);
}
throw $Exception;
}
......
......@@ -29,7 +29,7 @@
// fallback url for a product, with NO category
// this should never happen and is a configuration error
if (strpos(QUI::getRequest()->getPathInfo(), '_p/') !== false) {
if (str_contains(QUI::getRequest()->getPathInfo(), '_p/')) {
$_REQUEST['_url'] = QUI::getRequest()->getPathInfo();
if (strlen(URL_DIR) == 1) {
......@@ -133,7 +133,7 @@
}
// if product url is with lang flag /en/
if (strpos($productUrl, '/', 1) === 3 && strpos($productUrl, '/_p/') === false) {
if (strpos($productUrl, '/', 1) === 3 && !str_contains($productUrl, '/_p/')) {
$productUrl = mb_substr($productUrl, 3);
}
......@@ -304,7 +304,7 @@
$fields = Products\Utils\Sortables::getSortableFieldsForSite($Site);
foreach ($fields as $fieldId) {
if (strpos($fieldId, 'S') === 0) {
if (str_starts_with($fieldId, 'S')) {
$title = QUI::getLocale()->get('quiqqer/products', 'sortable.' . mb_substr($fieldId, 1));
$ProductList->addSort(
......@@ -320,7 +320,7 @@
continue;
}
if (strpos($fieldId, 'F') === 0) {
if (str_starts_with($fieldId, 'F')) {
try {
$fieldId = str_replace('F', '', $fieldId);
......@@ -361,7 +361,7 @@
}
if ($hasFilter && !$ProductList->count()) {
// keine produkte -> weiterleitung zu main
// keine produkte weiterleitung zu main
$Redirect = new RedirectResponse($Site->getUrlRewritten());
$Redirect->setStatusCode(Response::HTTP_SEE_OTHER);
......
......@@ -12,7 +12,7 @@
use QUI\ERP\Products\Handler\Products;
$productIds = $Site->getAttribute('quiqqer.products.settings.productIds');
$productIds = \explode(',', $productIds);
$productIds = explode(',', $productIds);
$products = [];
......