collectiveaccess / providence

Cataloguing and data/media management application
GNU General Public License v3.0
290 stars 166 forks source link

Prepopulate on branch develop 1.8 #1537

Closed andrea-favarin closed 1 month ago

andrea-favarin commented 4 months ago

In my test only addIfEmpty mode works, while overwrite does not cover the field. The issue was also confirmed by Monica with her tests. When I launch caUtils I get this:

[root@dev-wf2-cabe bin]# ./caUtils apply-prepopulate-rules PHP Warning: Module 'json' already loaded in Unknown on line 0 CollectiveAccess 1.8 (189/GIT) Utilities (c) 2013-2022 Whirl-i-Gig

Consiglio regionale del Piemonte 0.0% 1/11006 ETC: < 1 sec. Elapsed: < 1 sec [> ]PHP Fatal error: Uncaught Error: Cannot pass parameter 1 by reference in /data/www/html/cola/app/plugins/prepopulate/lib/applyPrepopulateRulesTool.php:117 Stack trace:

0 /data/www/html/cola/app/lib/Utils/BaseApplicationTool.php(173): applyPrepopulateRulesTool->commandApply_Prepopulate_Rules()

1 /data/www/html/cola/support/bin/caUtils(165): BaseApplicationTool->run()

2 {main}

thrown in /data/www/html/cola/app/plugins/prepopulate/lib/applyPrepopulateRulesTool.php on line 117 [root@dev-wf2-cabe bin]#

https://support.collectiveaccess.org/d/301591-prepopulate-on-branch-develop-18/10

collectiveaccess commented 4 months ago

Please try running this with current code. Judging by the copyright date and database revision you are running an old version of the branch.

andrea-favarin commented 4 months ago

Into the branch "develop" the copyright date (2013-2022) and database revision (189) are the same:

image

collectiveaccess commented 4 months ago

Please use dev/php8

andrea-favarin commented 4 months ago

The version dev/php8 also runs on php 7.2?

collectiveaccess commented 4 months ago

It'll run on PHP 7.4. You should not be using 7.2 at this point.

Monica-Wood commented 4 months ago

Hi Seth. I am on dev/php8 and I am finding that overwrite isn't always working on prepopulate either.

overwrite DOES work if using target and source (for containers) overwrite DOES NOT work if using target and template

I also get the error with apply-prepopulate-rules, but this happens if there is mode set to overwrite or not.

root@ca-dev:/var/www/providence# support/bin/caUtils apply-prepopulate-rules
CollectiveAccess 2.0 (195/GIT) Utilities
(c) 2013-2023 Whirl-i-Gig

Processing ca_storage_locations                                                                                                                              0.0% 1/31463 ETC: < 1 sec. Elapsed: < 1 sec [>                              ]PHP Fatal error:  Uncaught Error: prepopulatePlugin::prepopulateFields(): Argument #1 ($params) cannot be passed by reference in /var/www/providence/app/plugins/prepopulate/lib/applyPrepopulateRulesTool.php:117
Stack trace:
#0 /var/www/providence/app/lib/Utils/BaseApplicationTool.php(173): applyPrepopulateRulesTool->commandApply_Prepopulate_Rules()
#1 /var/www/providence/support/bin/caUtils(165): BaseApplicationTool->run()
#2 {main}
  thrown in /var/www/providence/app/plugins/prepopulate/lib/applyPrepopulateRulesTool.php on line 117

Fatal error: Uncaught Error: prepopulatePlugin::prepopulateFields(): Argument #1 ($params) cannot be passed by reference in /var/www/providence/app/plugins/prepopulate/lib/applyPrepopulateRulesTool.php:117
Stack trace:
#0 /var/www/providence/app/lib/Utils/BaseApplicationTool.php(173): applyPrepopulateRulesTool->commandApply_Prepopulate_Rules()
#1 /var/www/providence/support/bin/caUtils(165): BaseApplicationTool->run()
#2 {main}
  thrown in /var/www/providence/app/plugins/prepopulate/lib/applyPrepopulateRulesTool.php on line 117
collectiveaccess commented 4 months ago

Please send me your prepopulate config

Monica-Wood commented 4 months ago

@collectiveaccess I have emailed you my configuration. I don't need the overwrite at this time, but I was using this to test things in response to @andrea-favarin post on the forum. https://support.collectiveaccess.org/d/301591-prepopulate-on-branch-develop-18/10