WordPress.org

Forums

Custom Field Suite
[resolved] Image URL duplicate bug (25 posts)

  1. texasguy911
    Member
    Posted 1 year ago #

    I have the 1.0.7 version and it has a bug that at least comes from 1.0.6 or maybe earlier (though I think 1.0.4 might have been fine...).

    So, I have a loop with an image field inside.

    In the post, when I create a few rows of the loop and I update each image, the URL of the image I update gets copied to every other image of other rows. Thus, I cannot update other images because all rows duplicate the same URL.

    Javascript bug?

    It happens when I click "insert into post" the image and right after all the URLs are the same for all rows in the same loop....

    http://wordpress.org/extend/plugins/custom-field-suite/

  2. texasguy911
    Member
    Posted 1 year ago #

    And now I have the error all of the sudden on each page:

    Fatal error: Call to a member function load_value() on a non-object in /home/wp-content/plugins/custom-field-suite/core/api.php on line 99

  3. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    texasguy911 - thanks for reporting. You've been very helpful thus far.

    The loop bug has been fixed, and the fix will be released along with 1.0.8.

    As for the Fatal Error: I haven't been able to duplicate the issue. Have you been trying to add your own custom field types? The only thing I can think of right now is that a field was added with a field type that no longer exists.

  4. texasguy911
    Member
    Posted 1 year ago #

    Not sure, in the evening will trying to get to the bottom of this. Will post later what I find.

    BTW, when do you plan to release 1.0.8?

  5. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    It'll get released right after we figure out the Fatal Error issue you've been experiencing.

  6. texasguy911
    Member
    Posted 1 year ago #

    Well this is the dump for the $field object

    stdClass Object
    (
    [id] => 27
    [name] => project_name
    [label] => Project Name
    [type] => text
    [instructions] => Enter here project name
    [post_id] => 183
    [parent_id] => 0
    [weight] => 0
    [options] => a:1:{s:13:"default_value";s:0:"";}
    )

    The error happens on the very first loop through $fields.

  7. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    All that looks fine.

    Can you paste your template code now (or add it to pastebin.com)?

  8. texasguy911
    Member
    Posted 1 year ago #

    Which template?

  9. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    The code you're using to display CFS data on your site.

    E.g.

    $data = $cfs->get();
    foreach ($data as $field_name => $field_value) {
        ...
    }
  10. texasguy911
    Member
    Posted 1 year ago #

    Not sure if it is my code, just deleted 1.0.7, put 1.0.4 back and it is back working no problem.

    p*_h_p-c&h*ef.com - remove everything that is not a letter

  11. texasguy911
    Member
    Posted 1 year ago #

    I can paste in different versions until it gets broken, thus we would know at least what version breaks it, then you would have a ball park idea what was changed.

  12. texasguy911
    Member
    Posted 1 year ago #

    Versions 1.0.6 and up break it.
    1.0.4 and 1.0.5 are fine.

  13. texasguy911
    Member
    Posted 1 year ago #

    Template that drives front page and contact us.

    http://pastebin.com/amJapQYA

  14. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    It's hard to debug without being able to see your PHP code.

    The plugin was changed slightly in 1.0.6 to make it easier for developers to add custom field types. Each field type now extends a generic field class (cfs_Field). I don't see how that would cause the error you're seeing though.

    The error happens on the very first loop through $fields.

    Maybe you could show your loop code? ^

  15. texasguy911
    Member
    Posted 1 year ago #

    See the post above yours for a pastebin link.

  16. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    Cool, thanks. I'll look at it shortly.

  17. texasguy911
    Member
    Posted 1 year ago #

    Here is another template: http://pastebin.com/BZvZR7Bf

  18. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    For this template: http://pastebin.com/amJapQYA

    Try removing all instances of this:

    $cfs = new Cfs();

  19. texasguy911
    Member
    Posted 1 year ago #

    [deleted]

  20. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    $cfs already exists (it's created at the top of plugins/custom-field-suite/cfs.php). If it's undefined in your template, try:

    global $cfs;

    instead of

    $cfs = new Cfs();

  21. texasguy911
    Member
    Posted 1 year ago #

    Ok, so for the first pastebin file.

    If I DO NOT use $cfs = new Cfs(); then I get textfields fine but IMAGE fields are empty.

    If I DO use $cfs = new Cfs(); then everything works fine, it returns images as well.

    Tested with 1.0.5

  22. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

    Any chance you could switch back to 1.0.7 and give me a temporary /admin login?

  23. texasguy911
    Member
    Posted 1 year ago #

    quickly pastebin your email with 1 hour expire, I'll send the login

  24. logikal16
    Member
    Plugin Author

    Posted 1 year ago #

  25. texasguy911
    Member
    Posted 1 year ago #

    sent

    PS: if you want to contact me, email me, I get it on my phone.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic