ericmann / WP-Publication-Archive

Allows users to upload, manage, search, and download publications, documents, and similar content (PDF, Power-Point, etc.) in WordPress.
http://wordpress.org/extend/plugins/wp-publication-archive/
27 stars 12 forks source link

Possible Bug in class.wp-publication-archive.php #9

Closed julianlmedina closed 12 years ago

julianlmedina commented 12 years ago

There is a possible bug in the class.wp-publication-archive.php file that causes the All in One Event Calendar to create an error as displayed below.

Warning: Missing argument 2 for WP_Publication_Archive::the_title() in /home/stleos/public_html/wp-content/plugins/wp-publication-archive/lib/class.wp-publication-archive.php on line 320

I was able to remedy the problem by removing $id from line 320 in class.wp-publication-archive.php. From what I've seen so far this does not seem to damage WP Publication Archive. You might want to omit this in the next version to prevent conflict with the All in One Event Calendar plugin.

Thanks!

ericmann commented 12 years ago

No, this is not an error in WP Publication Archive.

WP Publication Archive hooks on to WordPress' built-in the_title filter. This filter is defined in /wp-includes/post-template.php on line 118 and takes in two parameters - the title itself, and the ID of the post.

WP Publication Archive adds a filter to this hook that also accepts two parameters, the title and the ID.

It looks like All in One Event Calendar is also adding a hook to this filter, but they're adding a hook that doesn't take two parameters.

If you want to skip this functionality all together, comment out the line that adds the title filter on line 53 in wp-publication-archive.php instead.

julianlmedina commented 12 years ago

Thanks for the suggestion! I just replaced the class.wp-publication-archive.php with the original and commented out line 53 in wp-publication-archive.php. Will commenting out the code affect anything with WP Publication? Thanks again! I certainly do appreciate it.

ericmann commented 12 years ago

It won't hurt. That filter is used primarily to add "(Download Publication)" to the title of a publication in the bulk editor screen. Removing it won't hurt at all, and I'll probably kill it in a future release anyway.

julianlmedina commented 12 years ago

Okay. Great! Glad I could keep both plugins. Once again thanks so much!