bainternet / Tax-Meta-Class

A class for creating WordPress taxonomies custom fields
http://en.bainternet.info/2012/wordpress-taxonomies-extra-fields-the-easy-way
GNU General Public License v3.0
406 stars 111 forks source link

Edit Taxonomy: Upload Image does not work #117

Open SpidermanPuddin opened 8 years ago

SpidermanPuddin commented 8 years ago

Images can be uploaded when added in a new taxonomy. However, if you edit that taxonomy images can't upload.

The issue persists even when all plugins are deactivated. The site is secure using SSL.

array('name'=> __('Image ','tax-meta')

maxledoux commented 8 years ago

The upload image function also does not work for me. the button does appear on the edit taxonomy page, but clicking on it does nothing.

It did work with my theme (Boss from BuddyBoss) prior to updating to WP 4.4.1.

On the other hand, it continues to work with a different theme on 4.4.1. So that is annoying.

I'm using with a custom post type: series.

$config = array(
    'id' => 'series_meta_box',          // meta box id, unique per meta box
    'title' => 'Series Info',          // meta box title
    'pages' => array('series'),        // taxonomy name, accept categories, post_tag and custom taxonomies
    'context' => 'normal',            // where the meta box appear: normal (default), advanced, side; optional
    'fields' => array(),            // list of meta fields (can be added by field arrays)
    'local_images' => true,          // Use local or hosted images (meta box images for add/remove)
    'use_with_theme' => true         //change path if used with theme set to true, false for a plugin or anything else for a custom path(default false).
  );

$meta    =  new Tax_Meta_Class($config); 

$meta->addImage('series_image',array('name'=> __('Series Image','tax-meta')));

$meta->Finish();
bainternet commented 8 years ago

please provide more details, or I wont really be able to help you.

what theme? any JavaScript errors in the browser console?

does the demo plugin work for you? if not then what happens when you try to upload?

A simple "not Working" is not something I can work with.

maxledoux commented 8 years ago

hi, @bainternet,

Thank you.

In my case, I did have errors in the console for loading the /css/Tax-meta-class.css and /js/tax-meta-clss.js files due to incorrect paths. However, I fixed that and I'm not getting the errors any more. (I did get TypeError: $('.at-color').wpColorPicker is not a function. (In '$('.at-color').wpColorPicker()', '$('.at-color').wpColorPicker' is undefined), fyi)

Unfortunately, I still was not able to upload images to the taxonomy after fixing those errors.

When I clicked on "Upload Image," simply nothing happened.

screen shot 2016-01-30 at 12 08 35 pm

I'm using "Boss" theme from buddyboss.com. However, adding images to taxonomies did work with this theme until WP 4.4.1, when I updated my Tax-meta-class files to version 2.1.0 from 1.9.9

I have been testing with no plugins activated.

I have reverted my Tax-meta-class files to 1.9.9 so I am now able to upload images to taxonomies once more.

SpidermanPuddin commented 8 years ago

I had the same error with incorrect paths and have resolved that. However, I get the same error as @maxledoux .

Uncaught TypeError: $(...).wpColorPicker is not a function

Still unable to upload images. When I click on "Upload Image," nothing happens.

I'm using Genesis and a customized "Magazine" theme. I'm using WordPress 4.4.2 and Tax-meta-class 2.1.0.

I have tested with no plugins active and still the same results.

christopher-wilson commented 8 years ago

I'm getting the same Uncaught TypeError as @SpidermanPuddin .

Eliatrope commented 8 years ago

Hi,

Im getting the same issue on the current version(2.1.0), with the upload image field/upload file field; the paths of css/js are invalid. Someone can share the version 1.9 please ? I need it but i dont know where i can found it... By the way, I use a personal theme(no child-theme used), perhaps this info could be useful

brknkfr commented 8 years ago

I have the same problem. Last commit which is working is c815b326520190983f60796f4c4c436c2f165478, after that, file image uploads aren't working anymore.

Eliatrope commented 8 years ago

At the moment, im working in local on my project. So, i changed the two options 'local_images' and 'use_with_theme' from false to true and it works... I dont know if this change is a solution for an online project, but you should maybe try it. Fixed for me right now then, hope this helped you...

Akamaozu commented 8 years ago

@maxledoux @SpidermanPuddin @christopher-wilson

Does this patch solve your problem?

Eliatrope commented 8 years ago

This seems to be solved for me(but i only tried in local, not with an online website)

brknkfr commented 8 years ago

This seems to fix the problem for me locally and on an online website.

SpidermanPuddin commented 8 years ago

@Akamaozu That fixes that problem on live. Thanks!

ghost commented 7 years ago

how to fixed ! php version 7.1

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1443

Warning: Cannot assign an empty string to a string offset in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1443

Warning: Illegal string offset 'id' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1447

Warning: Cannot assign an empty string to a string offset in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1447

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1449

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1449

Warning: Cannot assign an empty string to a string offset in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1449

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1467

Warning: Illegal string offset 'id' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1469

Warning: Illegal string offset 'url' in D:\xampp\htdocs\projects\edu-medic\wp-content\themes\edu\Tax-meta-class\Tax-meta-class.php on line 1471

MaralS commented 7 years ago

I'm developping a plugin and I added custom taxonomies. I try to figure out why the upload image doesn't work. Here is the code $config = array( 'id' => 'ms_author_meta', 'title' => 'Informations supplémentaires concernant les photographes.', 'pages' => array('ms_photo_author'), 'context' => 'normal', 'fields' => array(), 'local_images' => true, 'use_with_theme' => true ); $author_meta = new Tax_Meta_Class($config); $author_meta->addText( 'website',array('name' => 'Site Web')); $author_meta->addImage('avatar',array('name'=> 'Photo de profil')); $author_meta->Finish();