Why is WPML creating multiple file entries after saving - wpml

I have a Wordpress installation using WPML, ACF, and Custom Post Types. When I save a new entry for any custom post-type (also for Page) it is saving it as 2 or more entries. When I erase one of those entries, all of them are gone. When I try to remove them permanently from the trash, I get an error message.
Whenever I save a post I have two (or more entries) with the same title. When I want to delete it, it gives me this error:
Warning: mysqli_query(): (21000/1242): Subquery returns more than 1 row
in /wp-includes/wp-db.php on line 2056
WordPress database error: [Subquery returns more than 1 row]
SELECT translation_id FROM wp_icl_translations WHERE trid =
(SELECT trid FROM wp_icl_translations
WHERE element_id=3596 AND element_type='post_people')
When I do a translation into Spanish and save it - there are 3-6 posts in Spanish with the same title.
I tried with the WPML Form. Reinstalling all the plugins again. Reset things in the troubleshooting page. We have around 1000 entries and now we run into this problem.
Any idea where it could have gone wrong and how to solve it?

Related

Magento Page Builder - 500 Internal Server error

I just wanted to add a Slider block in my Magento 2.4.4 build in Pagebuilder and I'm getting an 500 Internal Server error when I click on Edit. I have this problem also with the Image block.
I have this in my browser console:
https://example.com/admin/mui/index/render_handle/buttons/1/key/3d12a8a6a2372ed459fc9684018ea6fbb954bd41478fe44d9f2e969ed409a639/?namespace=pagebuilder_slide_form&handle=pagebuilder_slide_form&isAjax=true
[HTTP/1.1 500 Internal Server Error 887ms]
Do you know where I can start to search where this is comming from?
The debug.log and system.log says:
magento main.ERROR: The requested store cannot be found.
I found the solution folowing the steps from Silas Palmer found here: https://magento.stackexchange.com/questions/156176/magento-2-requested-store-is-not-found?newreg=9ac715264c1949e69c8b1a78c0100133
That makes the error code more clear.
In my case it says:
main.ERROR: The store ID (3) that was requested wasn't found. Verify the store and try again.
So I crated a new store view and it works now.
Here is what I did:
This generally happens whenever config.php and the database get out of sync. For example, whenever I import a database back to my local development environment.
Here were the steps I used to troubleshoot and fix this.
Make the error messages more helpful:
Change vendor/magento/module-store/Model/StoreRepository.php to this (on your local, temporarily)
// Around line 74
if ($store->getId() === null) {
// Add this to see a backtrace
// debug_print_backtrace();
// Add this to see the store code causing the issue: (code:{$code})
throw new NoSuchEntityException(
__("The store (code:{$code}) that was requested wasn't found. Verify the store and try again.")
);
}
// .......
// Around line 114, same kind of thing...
if ($store->getId() === null) {
// debug_print_backtrace();
throw new NoSuchEntityException(
__("The store ID ({$id}) that was requested wasn't found. Verify the store and try again.")
);
}
Run php bin/magento s:up and make a note of the store id and/or store codes that are causing the issues. If you have added the backtrace, that will spool variables forever and you might need to do something like this instead: php bin/magento s:up > output.txt (wait 3 minutes, press ctrl-d to kill it) less output.txt
Go through app/etc/config.php and make sure all the stores line up with whatever is in the store table in the database. Note the store id from step 1, that will give you clues where to look. If there are differences, change config.php and not the database.
Run this against the database:
Change scope_id value (99) to whatever store_id you got in step #1
DELETE FROM core_config_data WHERE scope_id = 99
Change like value ('%xx_en%') to whatever store code you got in step #1
DELETE from flag where flag_data like '%xx_en%'
Run php bin/magento s:up again, hopefully there are no errors this time. Otherwise you may have to repeat some steps.

Not a valid identifier 'index,index.html' AEM 6.2

I get that error after deploying my project. Does anyone know how to fix it?
This appears in http://localhost:4502/ so, the damadmin, crx/de, system/console/* works good.
Complete error:
Not a valid identifier 'index,index.html'
Cannot serve request to / in org.apache.sling.servlets.get.DefaultGetServlet
Exception:
java.lang.IllegalArgumentException: Not a valid identifier 'index,index.html'
This is a typical issue where people have misconfigured the Index Resources section of the Apache Sling GET Servlet.
Visit /system/console/configMgr/org.apache.sling.servlets.get.DefaultGetServlet
Look at the Index Resources field.
If you have it like [ "index","index.html" ] then you've set it up wrong and will get this error in your error log
Instead they should be separate entries one above the other.
So make the first entry "index"
Then hit the plus sign on the right and add "index.html" as the next entry and hit save at the bottom.
People read the text below the configuration element too literally. It says "The default value is [ "index", "index.html" ]". So instead of reading that as a multi-value field with index and index.html as two values. They simply copy and paste it into the field and save. This creates that issue you've described.
Please please please do not do what e-israel suggests and delete your AEM installation by deleting the crx-quickstart folder. This is like formatting your drive or the linux equivalent of an rm -rf on your application directory. Terrifying suggestion and wanted to mention it for any poor person who dared follow it.

How to delete a referenced file?

In an 6.2.26 installation we have the following problem:
an editor wants to delete a file, which is not used any more.
if I click on the delete icon I primary get the warning about 3 references while in the list only 2 are shown:
if I agree I get the error message:
Trying to identify the problem in the database results in strange findings.
The data is no straight include but a two level IRRE construct (#1) and there once were workspaces installed (meanwhile removed)
so there are two references shown in the file list module we can only find one reference (or two references in case of the file with the shown four references)
the mm-records are deleted (deleted = 1) and show usage of workspaces (t3ver_id = 1, t3ver_label = 'First draft version')
after removing of these records and following cleanup-task (Dateiabstraktionsschicht: Speicherindex aktualisieren (scheduler)) there were no differences in the list or count of the references
How can we cleanup the database?
how can the editor delete the file?
(#1)
tt_content
+-(IRRE)-> tx_downloadlinks_domain_model_downloadbox
+-(IRRE)-> tx_downloadlinks_domain_model_links
+-> sys_file_references
+-> sys_file
These are probably references in sys_ref. Try to update the sys_ref table. Is one of the low-level cli commands

Workaround for saving / editing a VSTS test case

I have an issue with VSTS manual test cases. When I try to edit one, I got an error message as follows:
An element with the same key already exists in the dictionary
e</n.prototype.add#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:3:2142
ki</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:46195
bi</n.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40049
tf</t.prototype.onAddParameterInSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:62452
bi</n.prototype._updateParametersRefCountOnAddingStep/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39659
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
bi</n.prototype._updateParametersRefCountOnAddingStep#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:39614
bi</n.prototype._calculateParameterRefCountsFromSteps#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:40691
bi</n.prototype.setParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-view-1316919717-vxhr2NM2m2AZNsRLuD0JDHQ==:36:35794
yt</t.prototype.readParameters#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:58274
yt</t.prototype._onStepsLoaded#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:72430
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81038
yt</t.prototype._fetch#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:81408
yt</t.prototype.invalidate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async135478241-v-UPjjKxU6f1kHHOWlhqz1Q==:14:57579
c</n.prototype._onFieldChanged#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-async636480634-vHvWOSM8E8rCxBa3bYo2R7w==:149:2040
o/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:53:215
u#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:177
o</n.prototype.invokeHandlers#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:94:526
tr</n.prototype.fireEvent#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:100720
tr</n.prototype.fireFieldChange#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:103810
tr</n.prototype.evaluateFields#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112953
tr</n.prototype.evaluate#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:112662
tr</n.prototype._takeUpdateResult#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:110218
vi</t.prototype._beginSaveWorkItemsInternal/</</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74066
vi</t.prototype.beginGetWorkItemTypeExtensions#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:69585
vi</t.prototype._beginSaveWorkItemsInternal/</<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:74001
.each#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:12291
vi</t.prototype._beginSaveWorkItemsInternal/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-area-1319062352-vWRYJ179SKTshLwEQt_Tl9g==:35:73876
rt#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:938
l/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-common-1174969321-vP7TYoPIwwgcmodAk6tzLZw==:59:1252
i.Callbacks/l#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:35816
i.Callbacks/s.fireWith#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:36641
w#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:73448
.send/t/<#https://xxx.visualstudio.com/_public/_Bundling/Content?bundle=vss-bundle-basejs-1370396394-vpQOf5w8kp8_6mpJi9ABtBQ==:15:79367
Session Id: 73288d72-580f-42fb-9aeb-f5cadb6b3bc5
I only have this issue if a test step contains parameters. After refreshing the page and reopening the test case, the color code is black and it doesn't display the Save button. Also, the dropdown of the ... is empty.
Existing tests are fine, running them is also possible. Working with bugs, user stories and tasks is fine.
Screenshots can be found here
Is there a way to workaround this?
This is caused by the parameter name "#length", remove it or rename it to others like "#length1" would works.
This seems to be a bug with VSTS, I have help you created a feedback on MS Connect Page, refer to this link for details: "An element with the same key already exists in the dictionary" error occurs when save a test case contains a parameter named as "length".

Moodle local plugins and save_file

I've created a working form within a local plugin and it is inserting data fine into my custom table.
What I want tyo add now is a filepicker element that upon saving the form puts the file into a specified folder.
The filep[icker itself works fine but when I save the form no file appears, the code I'm using looks like this:
$mform->save_file('lowresCh', '/my_form/', false);
I've tried various things in the 'my_form' bit, but to no avail. The rest of the form still puts its data into the custom table and I can see my file in the mdl_files table (marked as draft).
With full debugging on I can get a warning of:
Warning: copy(/my_form/): failed to open stream: Is a directory in /...../lib/filestorage/stored_file.php on line 390
I don't know if I'm approaching it incorrectly or not, any help or pointers in the right direction would be most appreciated. 
Oh and I have read the Using the File API in Moodle forms page, useful in getting me to the point I'm at, but no further.
I solved it by using the filename as the second argument in save_file() and if I prepend a directory then all of the files will be saved within my plugin in a sub directory which is perfect.
So it looks like this now:
$mform->save_file('lowresCh', 'files/'.$mform->get_new_filename('lowresCh'), false);