No Code Attached Yet PHP 8.x
avatar Frostholm7
Frostholm7
8 Aug 2024

testing "[5.2][Events] Use event classes for custom fields plugins #43611"
testing formField "subform"

PHP 8.3.10, error_reporting = E_ALL

Test

new grupe "SubForm Test"
new field in grupe from 1: "subform" , "calandar" and "radio".
new Article
Fill in fields from 1 and 2. and saw.
Check the PHP logs.
log from:
PHP
C:\jo52\administrator\components\com_content\src\Model\ArticleModel.php on line
code:
// Increment the content version number.
$table->version++;
metode:
protected function prepareTable($table)
{
// Set the publish date to now
if ($table->state == Workflow::CONDITION_PUBLISHED && (int) $table->publish_up == 0) {
$table->publish_up = Factory::getDate()->toSql();
}

if ($table->state == Workflow::CONDITION_PUBLISHED && \intval($table->publish_down) == 0) {
    $table->publish_down = null;
}

// Increment the content version number.
**_$table->version++_;**

// Reorder the articles within the category so the new article is first
if (empty($table->id)) {
    $table->reorder('catid = ' . (int) $table->catid . ' AND state >= 0');
}

}
Platform:
C:\wamp64\bin\php\php8.3.10
error_reporting = E_ALL

Will try retesting on 5.1 dev to check my actual test target.
I don't think this has anything to do with the request I'm testing.

with PHP error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
no log entry with same test on new 5.1 dev and new 5.2.
NB I have not tried with earlier versions of Joomla (before 5.1)

Stack: (******* is my edit)
[07-Aug-2024 14:10:47 UTC] PHP Deprecated: Increment on non-alphanumeric string is deprecated in C:\jo52\administrator\components\com_content\src\Model\ArticleModel.php on line 350
[07-Aug-2024 14:10:47 UTC] PHP Stack trace:
[07-Aug-2024 14:10:47 UTC] PHP 1. {main}() C:\jo52\administrator\index.php:0
[07-Aug-2024 14:10:47 UTC] PHP 2. require_once() C:\jo52\administrator\index.php:32
[07-Aug-2024 14:10:47 UTC] PHP 3. Joomla\CMS\Application\CMSApplication->execute() C:\jo52\administrator\includes\app.php:58
[07-Aug-2024 14:10:47 UTC] PHP 4. Joomla\CMS\Application\AdministratorApplication->doExecute() C:\jo52\libraries\src\Application\CMSApplication.php:306
[07-Aug-2024 14:10:47 UTC] PHP 5. Joomla\CMS\Application\AdministratorApplication->dispatch($component = uninitialized) C:\jo52\libraries\src\Application\AdministratorApplication.php:195
[07-Aug-2024 14:10:47 UTC] PHP 6. Joomla\CMS\Component\ComponentHelper::renderComponent($option = 'com_content', $params = uninitialized) C:\jo52\libraries\src\Application\AdministratorApplication.php:150
[07-Aug-2024 14:10:47 UTC] PHP 7. Joomla\CMS\Dispatcher\ComponentDispatcher->dispatch() C:\jo52\libraries\src\Component\ComponentHelper.php:361
[07-Aug-2024 14:10:47 UTC] PHP 8. Joomla\CMS\MVC\Controller\BaseController->execute($task = 'save') C:\jo52\libraries\src\Dispatcher\ComponentDispatcher.php:143
[07-Aug-2024 14:10:47 UTC] PHP 9. Joomla\CMS\MVC\Controller\FormController->save($key = uninitialized, $urlVar = uninitialized) C:\jo52\libraries\src\MVC\Controller\BaseController.php:730
[07-Aug-2024 14:10:47 UTC] PHP 10. Joomla\Component\Content\Administrator\Model\ArticleModel->save($data = ['id' => '0', 'title' => 'En article', 'alias' => '', 'note' => '', 'version_note' => '', 'articletext' => '

rgtrrtytryybgfhyjj

', 'catid' => '2', 'state' => '1', 'created' => '', 'created_by' => '', 'created_by_alias' => '', 'modified' => '', 'publish_up' => '', 'publish_down' => '', 'featured_up' => '', 'featured_down' => '', 'version' => '', 'metakey' => '', 'metadesc' => '', 'access' => 1, 'language' => '', 'featured' => '0', 'rules' => ['core.delete' => [...], 'core.edit' => [...], 'core.edit.state' => [...]], 'attribs' => ['article_layout' => '', 'show_title' => '', 'link_titles' => '', 'show_tags' => '', 'show_intro' => '', 'info_block_position' => '', 'info_block_show_title' => '', 'show_category' => '', 'link_category' => '', 'show_parent_category' => '', 'link_parent_category' => '', 'show_author' => '', 'link_author' => '', 'show_create_date' => '', 'show_modify_date' => '', 'show_publish_date' => '', 'show_item_navigation' => '', 'show_hits' => '', 'show_noauth' => '', 'urls_position' => '', 'alternative_readmore' => '', 'article_page_title' => '', 'show_publishing_options' => '', 'show_article_options' => '', 'show_urls_images_backend' => '', 'show_urls_images_frontend' => ''], 'images' => ['image_intro' => '', 'image_intro_alt' => '', 'float_intro' => '', 'image_intro_caption' => '', 'image_fulltext' => '', 'image_fulltext_alt' => '', 'float_fulltext' => '', 'image_fulltext_caption' => ''], 'urls' => ['urla' => '', 'urlatext' => '', 'targeta' => '', 'urlb' => '', 'urlbtext' => '', 'targetb' => '', 'urlc' => '', 'urlctext' => '', 'targetc' => ''], 'metadata' => ['robots' => '', 'author' => '', 'rights' => ''], 'transition' => '', 'com_fields' => ['about-the-author' => '', 'subform-test' => [...]], 'schema' => ['extendJed' => ''], 'tags' => []]) C:\jo52\libraries\src\MVC\Controller\FormController.php:689
[07-Aug-2024 14:10:47 UTC] PHP 11. Joomla\CMS\MVC\Model\AdminModel->save($data = ['id' => '0', 'title' => 'En article', 'alias' => 'en-article', 'note' => '', 'version_note' => '', 'articletext' => '
rgtrrtytryybgfhyjj

', 'catid' => '2', 'state' => '1', 'created' => '', 'created_by' => '', 'created_by_alias' => '', 'modified' => '', 'publish_up' => '', 'publish_down' => '', 'featured_up' => '', 'featured_down' => '', 'version' => '', 'metakey' => '', 'metadesc' => '', 'access' => 1, 'language' => '', 'featured' => '0', 'rules' => ['core.delete' => [...], 'core.edit' => [...], 'core.edit.state' => [...]], 'attribs' => ['article_layout' => '', 'show_title' => '', 'link_titles' => '', 'show_tags' => '', 'show_intro' => '', 'info_block_position' => '', 'info_block_show_title' => '', 'show_category' => '', 'link_category' => '', 'show_parent_category' => '', 'link_parent_category' => '', 'show_author' => '', 'link_author' => '', 'show_create_date' => '', 'show_modify_date' => '', 'show_publish_date' => '', 'show_item_navigation' => '', 'show_hits' => '', 'show_noauth' => '', 'urls_position' => '', 'alternative_readmore' => '', 'article_page_title' => '', 'show_publishing_options' => '', 'show_article_options' => '', 'show_urls_images_backend' => '', 'show_urls_images_frontend' => ''], 'images' => '{"image_intro":"","image_intro_alt":"","float_intro":"","image_intro_caption":"","image_fulltext":"","image_fulltext_alt":"","float_fulltext":"","image_fulltext_caption":""}', 'urls' => '{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}', 'metadata' => ['robots' => '', 'author' => '', 'rights' => ''], 'transition' => '', 'com_fields' => ['about-the-author' => '', 'subform-test' => [...]], 'schema' => ['extendJed' => ''], 'tags' => []]) C:\jo52\administrator\components\com_content\src\Model\ArticleModel.php:780
[07-Aug-2024 14:10:47 UTC] PHP 12. Joomla\Component\Content\Administrator\Model\ArticleModel->prepareTable($table = class Joomla\Component\Content\Administrator\Table\ArticleTable { protected $_tbl = '#__content'; protected $_tbl_key = 'id'; protected $_tbl_keys = [0 => 'id']; protected $db = class Joomla\Database\Mysqli\MysqliDriver { private ${Joomla\Database\DatabaseDriver}database = 'JO52'; public $name = 'mysqli'; public $serverType = 'mysql'; protected $connection = class mysqli { ... }; protected $count = 30; protected $cursor = NULL; protected $executed = FALSE; protected $limit = 0; protected $nameQuote = '`'; protected $nullDate = '0000-00-00 00:00:00'; protected $offset = 0; protected $options = [...]; protected $sql = class Joomla\Database\Mysqli\MysqliQuery { ... }; protected $statement = class Joomla\Database\Mysqli\MysqliStatement { ... }; protected $tablePrefix = 'gun1q'; protected $utf = TRUE; protected $errorNum = 0; protected $errorMsg = NULL; protected $transactionDepth = 0; protected $factory = class Joomla\Database\DatabaseFactory { ... }; protected $monitor = NULL; private ${Joomla\Database\DatabaseDriver}dispatcher = class Joomla\Event\Dispatcher { ... }; protected $utf8mb4 = TRUE; protected $mariadb = FALSE }; protected $_trackAssets = TRUE; protected $_rules = class Joomla\CMS\Access\Rules { protected $data = [...] }; protected $_locked = FALSE; protected $_autoincrement = TRUE; protected $_columnAlias = ['published' => 'state']; protected $_jsonEncode = []; protected $_supportNullValue = TRUE; public $typeAlias = 'com_content.article'; private ${Joomla\CMS\Table\Table}dispatcher = class Joomla\Event\Dispatcher { protected $events = [...]; protected $listeners = [...] }; protected $_errors = []; public $tagsHelper = class Joomla\CMS\Helper\TagsHelper { protected $tagsChanged = FALSE; protected $replaceTags = FALSE; public $typeAlias = 'com_content.article'; public $itemTags = NULL; public $tags = NULL; public $newTags = NULL; public $oldTags = NULL }; private ${Joomla\CMS\Table\Content}currentUser = class Joomla\CMS\User\User { protected $isRoot = TRUE; public $id = 943; public $name = ''; public $username = ''; public $email = ''; public $password = '************'; public $password_clear = ''; public $block = 0; public $sendEmail = 1; public $registerDate = '2024-08-07 11:27:07'; public $lastvisitDate = '2024-08-07 13:47:53'; public $activation = '0'; public $params = ''; public $groups = [...]; public $guest = 0; public $lastResetTime = NULL; public $resetCount = 0; public $requireReset = 0; public $typeAlias = NULL; public $otpKey = ''; public $otep = ''; public $authProvider = ''; protected $_params = class Joomla\Registry\Registry { ... }; protected $_authGroups = [...]; protected $_authLevels = [...]; protected $_authActions = NULL; protected $_errorMsg = NULL; protected $_errors = [...] }; public $id = '0'; public $asset_id = NULL; public $title = 'En article'; public $alias = 'en-article'; public $introtext = '
rgtrrtytryybgfhyjj

'; public $fulltext = ''; public $state = '1'; public $catid = '2'; public $created = ''; public $created_by = ''; public $created_by_alias = ''; public $modified = ''; public $modified_by = NULL; public $checked_out = NULL; public $checked_out_time = NULL; public $publish_up = '2024-08-07 14:10:47'; public $publish_down = NULL; public $images = '{"image_intro":"","image_intro_alt":"","float_intro":"","image_intro_caption":"","image_fulltext":"","image_fulltext_alt":"","float_fulltext":"","image_fulltext_caption":""}'; public $urls = '{"urla":"","urlatext":"","targeta":"","urlb":"","urlbtext":"","targetb":"","urlc":"","urlctext":"","targetc":""}'; public $attribs = '{"article_layout":"","show_title":"","link_titles":"","show_tags":"","show_intro":"","info_block_position":"","info_block_show_title":"","show_category":"","link_category":"","show_parent_category":"","link_parent_category":"","show_author":"","link_author":"","show_create_date":"","show_modify_date":"","show_publish_date":"","show_item_navigation":"","show_hits":"","show_noauth":"","urls_position":"","alternative_readmore":"","article_page_title":"","show_publishing_options":"","show_article_options":"","s'...; public $version = ''; public $ordering = NULL; public $metakey = ''; public $metadesc = ''; public $access = 1; public $hits = NULL; public $metadata = '{"robots":"","author":"","rights":""}'; public $featured = '0'; public $language = ''; public $note = ''; public $newTags = [] }) C:\jo52\libraries\src\MVC\Model\AdminModel.php:1277

avatar Frostholm7 Frostholm7 - open - 8 Aug 2024
avatar joomla-cms-bot joomla-cms-bot - change - 8 Aug 2024
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Aug 2024
avatar laoneo
laoneo - comment - 9 Aug 2024

If you do a test, please make sure that you are testing it on a clean installation, so others can reproduce the issue.

avatar Frostholm7
Frostholm7 - comment - 9 Aug 2024

I could probably have written that more clearly.

It was during testing of "[5.2][Events] Use event classes for custom fields plugins #43611"

It was the build of the night (2024-08-08) for both 5.1-dev and 5.2-dev. Two new full installations.
With the same result.

Somehow, GIT ate my first report, and there was the description.
.
In my comment on #43611 is a description of what and how I tested.

Ps this is one of the changes in PHP that we have to deal with. There are other changes around it with ++/--.

Testet on:
Wampserver install version 3.3.2 installed on 2024-04-03
MySQL 8.2.0 Port 3306
Apache 2.4.62
PHP 8.3.10
error_reporting = E_ALL
Display Errors = on

avatar Frostholm7
Frostholm7 - comment - 18 Aug 2024

I have performed tests on 5.1-dev cb1b3e1 (2024-08-18)
with the same PHP 8.3.10. New installation and same test.
When you add your first version of an article, the version has a null value.

A fix like this:
// Increment the content version number.
if (empty($table->version))
$table->version = 1;
else
$table->version++;
removes the problem.
In a way, working with null values ​​in the database is part of it.

There are a few other components that work in the same way that probably need to be checked.
See https://www.php.net/manual/en/language.operators.increment.php
Karsten

avatar Fedik
Fedik - comment - 19 Aug 2024

@Frostholm7 as you have a fix, can you please make a PR?

avatar Fedik Fedik - labeled - 19 Aug 2024
avatar Fedik Fedik - change - 19 Aug 2024
Labels Added: PHP 8.x
avatar Frostholm7
Frostholm7 - comment - 19 Aug 2024

Yes, 4.4 or 5.1?

man. 19. aug. 2024 09.39 skrev Fedir Zinchuk @.***>:

@Frostholm7 https://github.com/Frostholm7 as you have a fix, can you
please make a PR?

β€”
Reply to this email directly, view it on GitHub
#43896 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/BKBHNK4PIQIOXSU6T4YF473ZSGOMFAVCNFSM6AAAAABMGNXV7SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOJVHA3TENJZGU
.
You are receiving this because you were mentioned.Message ID:
@.***>

avatar Fedik
Fedik - comment - 19 Aug 2024

4.4 should be good

avatar Quy Quy - change - 1 Oct 2024
Status New Closed
Closed_Date 0000-00-00 00:00:00 2024-10-01 05:26:42
Closed_By Quy
avatar Quy Quy - close - 1 Oct 2024
avatar Quy
Quy - comment - 1 Oct 2024

Please test PR #44173. Thanks.

Add a Comment

Login with GitHub to post a comment