Project:Custom Formatters
Version:6.x-1.4-beta1
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed (fixed)

Issue Summary

First, thank you for this module--it is really making life easier...

Very often (on the initial page load--the warning goes away on page refresh), when editing/saving/cloning a custom formatter, Drupal is giving me this error:
warning: Invalid argument supplied for foreach() in /var/www/vhosts/mysite/httpdocs/sites/all/modules/custom_formatters/custom_formatters.admin.inc on line 424.

Apache is giving me this error:
PHP Fatal error: Call to undefined function custom_formatters_formatter__editor_form() in /var/www/vhosts/mysite/httpdocs/sites/all/modules/custom_formatters/custom_formatters.admin.inc on line 128, referer: http://mysite/admin/settings/formatters/edit/12

Comments

#1

Hi dellis,

I wonder. did you upgrade the module or start fresh from 1.2? If it was an upgrade, best make sure you ran update.php.
Otherwise, I will investigate and see what I can come up with.

Cheers,
Deciphered.

#2

Thanks for the response Deciphered--I'm actually using the .dev version and started fresh with that version.

PS. The error doesn't seem to prevent anything from working, I just figured I should pass along the report.

Thanks!

#3

I've got some of this issue sorted and will be committed to the development release within the next 12 hours, but it's the other half, the second error, that concerns me the most.

Can you provide any more information about how you get the second error? What modules you have enabled (including sub-modules; text, number, etc), what versions of modules/drupal you are using and what version of PHP? Any specific steps you take to get this issue to occur?

Cheers,
Deciphered.

#4

I'll give you all the info I can...
php 5.2.6, drupal 6.15, jquery 1.3.2 (with jquery update)

The "second error" is simply the Apache error for the "first" error I get in the browser window. Hope this helps:

Modules Active:
Formatter Selector 6.x-1.1
Uberimage 6.x-1.1
Utilities 6.x-1-1
Admin 6.x-2.0-alpha5
Content 6.x-2.6
Content Copy 6.x-2.6
Custom Formatters 6.x-1.x-dev
Embedded Audio Field 6.x-1.18
Embedded Image Field 6.x-1.18
Embedded Media Field 6.x-1.18
Embedded Video Field 6.x-1.18
Fieldgroup 6.x-2.6
Filefield 6.x-3.2
Form Markup 6.x-1.1
Imagefield 6.x-3.2
Link 6.x-2.8
Markup 6.x-1.x-dev
Node Reference 6.x-2.6
Number 6.x-2.6
Option Widgets 6.x-2.6
Text 6.x-2.6

(Color, Comment, DB Logging, Help, Menu, Path, Taxonomy, Update Status and Upload 6.15)

Date 6.x-2.4
Date API 6.x-2.4
Date Popup 6.x-2.4
Date Timezone 6.x-2.4
Devel 6.x-1.18
Devel Generate 6.x-1.18
ImageAPI 6.x-1.6
ImageAPI GD2 6.x-1.6
ImageCache 6.x-2.0-beta10
ImageCache UI 6.x-2.0-beta10
Modal Frame API 6.x-1.6
Modal Frame Example 6.x-1.6
CKEditor 6.x-1.0
Flowplayer 6.x-0.3
IMCE 6.x-1.3
Jquery Tools 6.x-1.x-dev
Pathauto 6.x-1.2
Token 6.x-1.12
Automodal 6.x-1.x-dev
jQ 6.x-1.2
jQuery UI 6.x-1.3
jQuery Update 6.x-2.x-dev
Modal Node References 6.x-1.x-dev
Views 6.x-2.8
Views UI 6.x-2.8

#5

From what I can see from the errors, the second error isn't really connected to the first, the error is that the function being invoked relies on a variable being populated from the database, and for some reason that isn't happening and that's causing an incorrect function being called. This shouldn't be a side-effect of the other issue, but I would be ok if it was as the other issue should now be fixed.

Have a play with the latest development build and let me know if everything is fine now.

Cheers,
Deciphered.

#6

I have the same error.
Had it on 6.x-1.3 so i installed the dev version i get the same error.
I even get it on the example formatters.

* warning: Invalid argument supplied for foreach() in /home/clubjaco/domains/clubjaco.nl/public_html/beta/sites/default/modules/custom_formatters/custom_formatters.admin.inc on line 429.
* warning: preg_match() expects parameter 2 to be string, array given in /home/clubjaco/domains/clubjaco.nl/public_html/beta/includes/bootstrap.inc on line 777.
* warning: preg_match() expects parameter 2 to be string, array given in /home/clubjaco/domains/clubjaco.nl/public_html/beta/includes/bootstrap.inc on line 777.
* warning: preg_match() expects parameter 2 to be string, array given in /home/clubjaco/domains/clubjaco.nl/public_html/beta/includes/bootstrap.inc on line 777.
* warning: preg_match() expects parameter 2 to be string, array given in /home/clubjaco/domains/clubjaco.nl/public_html/beta/includes/bootstrap.inc on line 777.

* warning: Missing argument 2 for custom_formatters_token_values() in /home/clubjaco/domains/clubjaco.nl/public_html/beta/sites/default/modules/custom_formatters/modules/token.inc on line 31.
* warning: preg_match() expects parameter 2 to be string, array given in /home/clubjaco/domains/clubjaco.nl/public_html/beta/includes/bootstrap.inc on line 777.

Thanx for the hard work.

#7

The message was all over the site really random it seems.
I figured out the the error showed up after i read the manual en tested the setting with the devel module.
After i disabled the devel module error disappeared on the editing ui for custom formatters.

#8

this one comes up on edit page of all content.

warning: Missing argument 2 for custom_formatters_token_values() in /home/clubjaco/domains/clubjaco.nl/public_html/beta/sites/default/modules/custom_formatters/modules/token.inc on line 31.

#9

I wonder if it is a different issue from the one which opened this thread.

i have the same problem after updating from 6.x-1.x-dev from two days ago or so to 6.x-1.3. It remains when I upgrade to the current dev version: yes it does!

#10

Just a quick note, the current dev version is 1.3, there is absolutely no difference.

 

Can you guys let me know what versions of PHP, Drupal and any relevant modules you are running?

 

@mauricemengel Which error are you getting? Of the two that where originally reported, only one should still be an issue.

 

Unfortunately I have not been able to reproduce any of these issues (other than the one that I have already fixed), I will keep trying, but it suggests that the issue is somewhat server related, so anything you guys can think of, or do, to help me would be greatly appreciated.

Cheers,
Deciphered.

#11

Sorry. It's getting late. I had the same problem as described in #8 after updating to 1.3/dev. So I looked into token.inc and made the second parameter optional:

function custom_formatters_token_values($type, $object=array()) {

Apparently, $object is only needed when $type is "field". Not sure if this is a good idea, but it made the error message disappear.

Current Drupal 6.15, php 5.2.4 on ubuntu.

#12

Thanks,

That is the fix I was going to suggest, but I wanted to test it first. It will be committed ASAP.

Cheers,
Deciphered.

#13

Just want to weigh in and say that I'm getting the same errors as #8 all over watchdog.

#14

Hi Joel,

Try the fix from #11:
Change line #31 of modules/token.inc from:

function custom_formatters_token_values($type, $object) {

To:

function custom_formatters_token_values($type, $object = array()) {

Sad that this got missed, looks like I'll be pushing out a very minor bug fix release for 1.4 before the end of the day :(

Cheers,
Deciphered.

#15

Thanks! That does the trick. Don't worry too much about having to release more than once today. I think we would all rather have that than releases which take forever to happen.

Thanks again for your hard work!

#16

Fixed in 1.4-beta1, with some additional features.

Let me know how it goes.

Cheers,
Deciphered.

#17

I updated and have no error messages, so looks good. Thx for mentioning me ;-)

#18

When I open: admin/settings/formatters/edit/4

I get the message

* warning: Invalid argument supplied for foreach() in /var/www/vhosts/mimo-project.eu/httpdocs/sites/all/modules/custom_formatters/custom_formatters.admin.inc on line 565.
* warning: Invalid argument supplied for foreach() in /var/www/vhosts/mimo-project.eu/httpdocs/sites/all/modules/custom_formatters/custom_formatters.admin.inc on line 565.

looks like the very similar

EDIT: This went away like the error in #19, so I didn't run cron.php or so.

#19

Version:6.x-1.x-dev» 6.x-1.4-beta1

I also get this after saving my advanced custom format

warning: Missing argument 1 for custom_formatters_overview() in /var/www/vhosts/mimo-project.eu/httpdocs/sites/all/modules/custom_formatters/custom_formatters.admin.inc on line 8.

Result is cannot get the list of formatters at /admin/settings/formatters.

This went away, without further ado. It seems this error was related to me updating. Probably I didn't run cron or so.

#20

Working good now,

No more errors, enabled the devel module and had no problems.
Playing with module now.

Thanx for the hard work RESPECT,

Greetings JoopDope

#21

Status:active» fixed

That's fantastic news.

Marking as fixed.

Cheers,
Deciphered.

#22

Thanks for your follow through with this. This module is a huge help!

#23

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

#24

warning: Invalid argument supplied for foreach() in /.../sites/all/modules/custom_formatters/modules/fieldgroup.inc on line 67.

I'm getting this upon submitting Display fields for a content type that is serving as Content Profile using Advanced Profile Kit (uprofile). I didn't have the error before adding some multigroup fields to the node type.

I haven't tested enough yet, but I'm also not getting a second or third entry in those multigroup fields when viewing the profile, not sure if it's connected.

This was with v 6.x-1.5

#25

I got the same warning (#24). Anyone has solutions for this?

I have a node containing a multigroup field group in a standard field group. When I view the node, I got the warning.

Peijun Zhang

#26

Guys,

This is a closed issue from February for Custom Formatters 6.x-1.4-beta1. I will not help you in a closed issue, especially an old closed issue for an outdated beta version of the module.

Open a new issue and if it's related to this issue link back to this issue. Also, please confirm that your issue is still an issue in the latest development release.

Cheers,
Deciphered.