User:Taylan/CargoBugTest

From bg3.wiki
Jump to navigation Jump to search

This page showcases a bug in the Cargo extension. Auto-generated column names break upon the presence of a period.

Example 1[edit | edit source]

{{#cargo_query: tables = weapons
| fields = name, CONCAT("Test1.Test2.Test3.")
| where = name = "Adamantine Longsword"
}}
name Test2.Test3.")
Adamantine Longsword Test1.Test2.Test3.

Example 2[edit | edit source]

The behavior changes depending on whether there's a space after the period.

This one causes an error to be logged by PHP, saying the column " Test2. Test3." couldn't be found, and the data isn't shown.

{{#cargo_query: tables = weapons
| fields = name, CONCAT("Test1. Test2. Test3.")
| where = name = "Adamantine Longsword"
}}
name Test2. Test3.")
Adamantine Longsword

Example 3[edit | edit source]

To work around the bug, make sure to give the column a proper name:

{{#cargo_query: tables = weapons
| fields = name, CONCAT("Test1.Test2.Test3.") = test
| where = name = "Adamantine Longsword"
}}
name test
Adamantine Longsword Test1.Test2.Test3.

Example 4[edit | edit source]

The space after the period also doesn't matter anymore if you use that work-around:

{{#cargo_query: tables = weapons
| fields = name, CONCAT("Test1. Test2. Test3.") = test
| where = name = "Adamantine Longsword"
}}
name test
Adamantine Longsword Test1. Test2. Test3.