e107inc / e107

e107 Bootstrap CMS (Content Management System) v2 with PHP, MySQL, HTML5, jQuery and Twitter Bootstrap. Issue Discussion Room: https://gitter.im/e107inc/e107
https://e107.org
GNU General Public License v3.0
319 stars 213 forks source link

Forum Attachments #3731

Open Bobbycharlton1 opened 5 years ago

Bobbycharlton1 commented 5 years ago

in e107 V1 I could attach multiple files/images to a forum post. in V2 it allows only 1? then if I press preview, it does not show a preview of the image I attached?

Moc commented 5 years ago

There are some issues with forum attachments indeed.

Related #3496

NECPWAweb commented 4 months ago

In 2.3.3 there are still some issues. Even if I set img width to 1024 in forum admin with a 56kb file measuring 495 x 700 I get a 'file too large' message with upload limits set at 20mb

Now having updated from V1.1.4 to 2.3.3 I noticed a folder inside the forum plugin 'attachments' so none of the existing ones appeared. (I had a modified setup storing attachments by user id in the forum plugin folder so don't know about the OE 1.1.4 setup)

Looking at the posts that have been moved from V1.1.4 to v 2.3.3 none of the existing images appeared even though I still have the old 'attachment' folder in place.

But by removing the {e_PLUGIN} from the IMG link path and replacing with a full http:// link the images appear, so is there a shortcode issue with {e_PLUGIN} in the forums?

EDIT:

OK digging a bit further, if I copy the old 'attachment' folder into e107_images, and use the {e_IMAGE} shortcode instead of e_PLUGIN in the old forum posts then the old attached images show in forum posts so I can live with that.

But adding images to new forum posts is still an issue for me.

NECPWAweb commented 3 months ago

Well image attachment does work now using php 7.4 but, there is only the option to attach 1 image, nothing shows on 'preview' but the image appears if you simply add 1, don't preview i, just post.

However, IF you go and 'edit' the post, there is no image path to see, copy or edit so there are some issues.

Jimmi08 commented 3 months ago

To have this topic complete: preview worked in 2022 https://github.com/e107inc/e107/issues/4726

NECPWAweb commented 3 months ago

To have this topic complete: preview worked in 2022 #4726

No idea why then, but for me using bootstrap5 theme, preview shows nothing, post edit shows nothing, no path to the image when logged in as main admin in Firefox or chrome using the full v2.3.3 file download from e107.

Integrity check doesn't show any errors either

NECPWAweb commented 3 months ago

OK More Info:

Debug Log

Message | Function | File | Line -- | -- | -- | -- Session Save Method: db | e_session->setDefaultSystemConfig()() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/e107_handlers/session_handler.php | 931 Timezone: Europe/London | init_session() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/class2.php | 672 e_URL in forum with key: post matched ^forum/post/? and included: ./e107_plugins/forum/forum_post.php with $_GET: Array ( [f] => rp [id] => 1036 [post] => 1036 ) | e_url->run()() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/index.php | 65 array ( 'viewport' => array ( 'name' => 'viewport', 'content' => 'width=device-width, initial-scale=1.0', ), 'dcterms.rights' => array ( 'property' => 'dcterms.rights', 'name' => 'dcterms.rights', 'content' => 'NECPWA Motoring Club', ), 'author' => array ( 'property' => 'author', 'name' => 'author', 'content' => 'NECPWA', ), ) | eResponse->renderMeta()() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/e107_core/templates/header_default.php | 198 Using HTML layout: full.html | e_theme::loadLayout()() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/e107_core/templates/header_default.php | 584 Using Permlist cache: True | e107forum->loadPermList()() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/e107_plugins/forum/forum_class.php | 107 Possible issue: Missing a Unique Tablerender ID. Use $ns->setUniqueId() in the plugin script prior to setContent(). See 'source code' for more information. | e_render->setContent()() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/e107_handlers/e_render_class.php | 391 Possible issue: Missing a Unique Tablerender ID. Use $ns->setUniqueId() in the plugin script prior to setContent(). See 'source code' for more information. | e_render->setContent()() | /home/sdg1c8bl66rc/additional_domains/necpwa.org/public_html/e107_handlers/e_render_class.php | 391 Magic Shortcodes Replace [ ] with { }Array ( [---CAPTION---] => Preview [---FOOTER---] => [---TEXT---] => [---TITLE---] => [---IMAGE---] => [---LIST---] => [---BREADCRUMB---] => )

PHP Errors php error

NECPWAweb commented 3 months ago

php error

Jimmi08 commented 3 months ago

You are right. It stopped working for me too - I have the updated version of the forum plugin from 2022, I just checked this one when I was sure it worked. I have a local version of bootstrap5 used (not CDN).

The code is correct, check your console for javascript error.

Uncaught TypeError: Cannot read properties of undefined (reading 'classList')
    at Hi._isAnimated (bootstrap.bundle.min.js:6:53067)
    at Hi._initializeBackDrop (bootstrap.bundle.min.js:6:51282)
    at new Hi (bootstrap.bundle.min.js:6:49838)
    at Hi.getOrCreateInstance (bootstrap.bundle.min.js:6:6729)
    at HTMLAnchorElement.<anonymous> (bootstrap.bundle.min.js:6:54365)
    at HTMLDocument.n (bootstrap.bundle.min.js:6:4406)
NECPWAweb commented 3 months ago

Sorry, you lost me now with js error. Tried with & without CDN in 'Libraries' and both cdnjs and jsDelivr all with the same result, nada.

Jimmi08 commented 3 months ago

@NECPWAweb my modal is not working because this error after click on attachment preview: (F12, console tab). It can be frontend theme issue, investigating now.

image

NECPWAweb commented 3 months ago

OK just to clarify, I have 'Hero' Downloads, Sitemap and forum plugins installed on site.

Jimmi08 commented 3 months ago

Preview in latest 2.3.4 (just synced) core bootstrap5 theme, core forum plugin, it works.
Now I need to find why it doesn't with my bootstrap 5 theme... image

EDIT - solution

My theme.html file was missing {---MODAL---} shortcode. So forum modal didn't work. in your source code you must have <div id="uiModal"> element

Tested: latest core + core forum plugin latest core + custom forum plugin custom theme + custom forum plugin

NECPWAweb commented 3 months ago

All that appears in my core 2.3.3 bootstrap5 theme.html is: {---MODAL---}

What needs to be added for the full element as there is nothing in core bootstrap3 either in the 2.3.3 release?