- Issue created by @rmorelli
- ๐ฆ๐ทArgentina tguerineau
Hi @rmorelli,
I've tried to reproduce this issue on a Drupal 10 environment with PHP 8.1 and the Charts module version 5.0.x-dev, which is the same version mentioned in this issue.
Here are the steps I followed:
1- I added a chart field to the Article content type with unlimited values.
2- Created a new article without any data in the chart field and saved it. I observed that no empty chart was added.
3- I edited the article but not the chart field and saved it again. Still, no empty chart was appended.
4- Finally, I added data to the chart field, saved the article and then I went to edit mode and saved it. I observed the chart displayed correctly with the added data.Upon following these steps, I couldn't replicate the issue of empty charts being added or being unable to remove them.
Questions:
- Could you provide more details on your environment?
- Are there any other modules interacting with the Charts module?
- Any special configurations or settings you have applied?Thank you!
- ๐ฎ๐นItaly rmorelli
Hi,
- Drupal Version 9.5.8
- Web Server Apache/2.4.56 (Debian)
- PHP Version 7.4.33 (I should upgrade but php 8.0 breaks an old site on the same server)I am developing a custom module with no interactions going on, I had "Chart suite" installed but removed when started testing Charts.
I have no clue about other modules interacting, attached non core module listI can provide you an account on the web site I am doing tests.
Moreover, using unlimited values, field configuration form has 2 charts for default values
Still can't see where charts can be removed. - ๐บ๐ธUnited States andileco
Moving this to a support request, as I have not experienced this and @tguerineau was not able to replicate.
- ๐บ๐ธUnited States helianthropy
Iโm experiencing this using Charts with the Paragraphs module on Drupal 9.5 and PHP 7.4 (will test on PHP 8.1). Iโve also noticed this behavior with Address fields (with default values set) in a Paragraphs module under Drupal 7.
Have you tried changing default values for the Charts module to see if that makes it reproducible (Iโve done so in my installโspecifically perhaps chart type and definitely the colors)?
- ๐ฎ๐นItaly rmorelli
hi @Heliantropy
I actually switched back to Drupal 9.5.11 and going to test on this fresh installation soon.
- ๐บ๐ธUnited States helianthropy
@rmorelli
Looking forward to hearing about the experience. I found that if I set a fixed maximum, it creates that fixed maximum right away.
The duplication is an annoyance, but not being able to remove extra instances is a real challenge.
Iโm using billboard.js via CDN and am seeing some javascript errors from it of "f is undefined." Going to try a local library to see if that makes a difference.
- ๐ฎ๐นItaly rmorelli
The website encountered an unexpected error. Please try again later.
TypeError: Drupal\charts\Element\ChartDataCollectorTable::getCategoriesFromCollectedTable(): Argument #2 ($type) must be of type string, null given, called in /home/www/drupal-9.5.11/web/modules/contrib/charts/src/Element/Chart.php on line 348 in Drupal\charts\Element\ChartDataCollectorTable::getCategoriesFromCollectedTable() (line 722 of modules/contrib/charts/src/Element/ChartDataCollectorTable.php).Got this fresh new error.
Moreover I can't upload csv anymore. - ๐บ๐ธUnited States andileco
I think the main issue is really here: https://www.drupal.org/project/drupal/issues/2980806 ๐ Fields with unlimited cardinality show 1 extra input field Needs work
However, I will try to find a way to address it.
- last update
about 1 year ago 10 pass - @andileco opened merge request.
- ๐บ๐ธUnited States andileco
In the merge request/patch (you can download from the merge request), I've added a method that checks if there are data before adding the chart. For me, solving the Core issue would be ideal, but you can use this patch in the meantime, that should help.
- ๐ฎ๐นItaly rmorelli
I confirm that a new empty chart is being added on every save on drupal 9.5.11
No default chart type is selected (area, bar, ...) so saving field definition throws error in #5
- last update
about 1 year ago 10 pass - last update
about 1 year ago 10 pass - last update
about 1 year ago 10 pass -
andileco โ
committed 0d5bd1a9 on 5.0.x
Issue #3384225: Empty charts added on every save, can't remove charts
-
andileco โ
committed 0d5bd1a9 on 5.0.x
- Status changed to Fixed
about 1 year ago 5:08pm 26 October 2023 - ๐บ๐ธUnited States andileco
Marking this as fixed. If we want to go back and provide a better solution later, let's do that in a separate ticket.
Automatically closed - issue fixed for 2 weeks with no activity.