I just checked my logs and saw a handful of the following PHP warnings from tablefield:

Warning: Invalid argument supplied for foreach() in theme_tablefield() (line 2455 of drupal/sites/all/modules/contrib/tablefield/tablefield.module).

Comments

jenlampton created an issue. See original summary.

lolandese’s picture

Can you give some steps to reproduce the issue?

lolandese’s picture

Status: Needs review » Postponed (maintainer needs more info)
jenlampton’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

> Can you give some steps to reproduce the issue?

I'm not seeing this issue in the 3.x branch of the module anymore. I expect it has been resolved differently. Closing issue.

efrainh’s picture

Status: Closed (cannot reproduce) » Active
StatusFileSize
new195.04 KB

I'm reopening this ticket because i just found the same issue. I'm providing the steps to reproduce it:

  1. Go to https://simplytest.me/, enter the project name tablefield and select the version 7.x-3.5, then click on the button Launch sandbox. You can also setup a new site on your local machine with Drupal 7.67 and the same module version.
  2. Edit the content type Article and add a new field using the type tablefield
  3. Configure the field with the default values but rebuild the table setting for example 2 columns and 1 row
  4. Add a new article and import a CSV file with data (upload the file and save the article). By this time you might have seen the warnings.
  5. View the article or edit it and save, then check the recent logs and you will have dozens of warnings
efrainh’s picture

Another issue that i found is that when trying to import a new CSV file on a node I had previously uploaded another CSV file and saved, it uploads the file and show its data but when i save the node the new data gets lost and the old data remains. So basically the first time i import the data using a CSV file it works correctly but the second time it doesn't because it doesn't overwrite the old data. I did the same steps described in #5 when this happened. The only message i see in the logs is the warning mentioned on this issue so i guess that is causing this.

lolandese’s picture

Hi Efrain. Thanks for the steps you provided to reproduce the issue. Very helpful.

I could indeed trigger it on the 7.x-3.5 version, however, when doing the same steps with the dev version (7.x-3.x), all was fine. Similar as reported in comment #4 above.

The weird thing though is that that comment was made on 22 April, thus before the 7.x-3.5 was released (29 May). The only way forward IMHO is that if you confirm that the dev version solves your problem (not only on SimplyTest but in "real"). In that case, I will release a new stable version. Then we should keep our fingers crossed there is no different behavior between a dev and a stable version that use the same codebase. Theoretically, that is impossible. The only way that could happen is that the environment is spun up differently for a dev and a stable module. In that case, we should investigate further and maybe look into a solution like Invalid argument supplied for foreach() - Stack Overflow.

Please, test the dev version and let us know.

liam morland’s picture

Status: Active » Closed (outdated)

Drupal 7 is no longer supported. If this applies to a supported version, please re-open.

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.