[3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

A place for Extension Authors to post and receive feedback on Extensions still in development. No Extensions within this forum should be used within a live environment!
Ideas Centre
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

IMPORTANT: Extensions Development rules

IMPORTANT FOR NEEDED EVENTS!!!
If you need an event for your extension please read this for the steps to follow to request the event(s)
mrix2000
Registered User
Posts: 1280
Joined: Sun Dec 03, 2006 2:23 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by mrix2000 »

I have standard registered members who cannot rotate their images as they state they get a permissions error :?
Where are the permissions added or is the rotation allowed for all to use ?
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

Hello!
Should be all users that can edit posts, and posts owners.
Still in trouble?
Please report all things that you think could help to reverse/reproduce the thing (user's group etc)
Do not take me too serious
Anyway i do not like Discourse
mrix2000
Registered User
Posts: 1280
Joined: Sun Dec 03, 2006 2:23 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by mrix2000 »

Ok thanks, I will first check they are going through the correct process.
mrix2000
Registered User
Posts: 1280
Joined: Sun Dec 03, 2006 2:23 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by mrix2000 »

I had a member using a iphone who uploaded images but could not rotate the images due to a error showing as below where he uploaded to image but when he went to rotate it showed no attachment found :? , I used my Samsung phone with no issue at all.
You do not have the required permissions to view the files attached to this post.
User avatar
Steve
Registered User
Posts: 1556
Joined: Tue Apr 07, 2009 7:48 pm
Location: Co. Durham, England
Name: Steven Clark

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by Steve »

looking at the code on GitHub. I’m no expert but the op should read these pages.
It will help you.
https://www.phpbb.com/extensions/
https://area51.phpbb.com/docs/33x/codin ... lines.html
@ The Chief Medical Officers guideline for men is that: You are safest not to drink regularly more than 14 units per week.
- I drank that today++ :lol: 🍺
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by 3Di »

Steve wrote: Tue Mar 29, 2022 3:30 pm looking at the code on GitHub. I’m no expert but the op should read these pages.
Yeah, I told him about that 2 years ago but... :|
The present code is a no-no in my opinion as well. :ugeek:
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

I had a member using a iphone who uploaded images but could not rotate the images due to a error showing as below where he uploaded to image but when he went to rotate it showed no attachment found :? , I used my Samsung phone with no issue at all.
Never reported, let check asap and i will return in reply.
Do you have the console error?
I will try with ipad i have

others two answers:
looking at the code on GitHub. I’m no expert but the op should read these pages.
It will help you.
may just do not use, write your own*
Yeah, I told him about that 2 years ago but
i told u the same if not wrong, and gave full access, but the answer was: too much complicate.

*Come on Steve, show us your skills and time on improve this! I'll give u immediate access, do u like?

Yeah, my girlfriend sent me to the hell another time this evening and now i am little nervous :D
Do not take me too serious
Anyway i do not like Discourse
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by 3Di »

axe70 wrote: Tue Mar 29, 2022 8:05 pm i told u the same if not wrong, and gave full access, but the answer was: too much complicate.
I don't remember, though.

The problem is not the complexity but the fact that it would have to be rewritten from scratch, which I certainly don't intend to do even for a fee in this case, the project doesn't interest me. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

Ok. I know why.
Because to do what i did respecting phpBB code guideline, may you'll have a big headache, while this way, it is very simple and short.

And just to say, like you into your profile sign:
I stand with Russia.
Do not take me too serious
Anyway i do not like Discourse
User avatar
3Di
I've Been Banned!
Posts: 17538
Joined: Mon Apr 04, 2005 11:09 pm
Location: I'm with Ukraine 🇺🇦
Name: Marco

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by 3Di »

The only one who has trouble respecting the guidelines is you here, it seems.

The code is yours but unfortunately this is phpBB not WP. :)
🆓 Free support for our extensions also provided here: phpBB Studio
🚀 Looking for a specific feature or alternative option? We will rock you!
Please PM me only to request paid works. Thx. Buy me a coffee -> Image
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

Just to return to the question and not loose what i will have to answer to (so i will remember):
I had a member using a iphone who uploaded images but could not rotate the images due to a error showing as below where he uploaded to image but when he went to rotate it showed no attachment found :? , I used my Samsung phone with no issue at all.
Never reported, let check asap and i will return in reply.
Do you have the console error?
I will try with ipad i have


Marco: i started coding the way i did, because i was not able to understand the way phpBB do some of the things.
But the result is shorter code and that work.
Now i know little better, and i could do completely as required. Anyway, like you, i should so stolen time to something else to do so.
You are and you was not interested on improve, may just indicating some code line example, making for me easy something, so now you say me it is phpBB and not WP. I do not well understand the meaning. But ok.
May phpBB on next versions will implement a native option about this.
If not, i or someone else, i hope will move this to the final step for validation.

P.s I said: I stand with Russia. It is not completely true, but i recognize reasons. I really worry for all suffering people in Ukraine, and i blame all together because after all, the poor people, always, is the one that suffer. And i hate this.
Do not take me too serious
Anyway i do not like Discourse
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

mrix2000 wrote: Tue Mar 29, 2022 2:33 pm I had a member using a iphone who uploaded images but could not rotate the images due to a error showing as below where he uploaded to image but when he went to rotate it showed no attachment found :? , I used my Samsung phone with no issue at all.
So, i will to try to fix this aspect soon, even i do not own a MAC to debug, but only an iPAD. That yes, seem to have problem with the javascript so that it make it fail the image rotation.
But i experienced this only into ipad.

BUT the main problem now fixed on fly (i will re-code all about) is about the fact that if i am posting a new topic, a topic into related table, still do not exist, so the query as it was, fail.
The w3all/imageattachrotation/core/fileRotate.php

https://github.com/axew3/phpBB-image-at ... Rotate.php
has been patched to resolve this issue, not in a so elegant way, but that at moment until all not re-write, will work fine:

Code: Select all

// It is required also the forum id of this attach, to know if this user can or not execute things here
// TODO: unique query to retrieve all data
 $sql = 'SELECT T.*, A.*
  FROM ' . ATTACHMENTS_TABLE . " AS A
  JOIN " . TOPICS_TABLE . " AS T on T.topic_id = A.topic_id
  WHERE A.attach_id = $attach_id";
 $result = $db->sql_query($sql);
 $attachment = $db->sql_fetchrow($result);
 $db->sql_freeresult($result);

if (!$attachment) // may it is an attachment just uploaded and a topic do not exist
{
 $sql = 'SELECT * 
	FROM ' . ATTACHMENTS_TABLE . "
	WHERE attach_id = $attach_id";
 $result = $db->sql_query($sql);
 $attachment = $db->sql_fetchrow($result);
 $db->sql_freeresult($result);
}
Because if it is a new file added into a new topic that still do not exist, it was returning error.
Now this is fixed, so even when the rotation happen into a new topic and not into an edited one, it will be correctly processed here (hope my mess explain is quite clear)

so just download and replace
The w3all/imageattachrotation/core/fileRotate.php

The other issue that is about JS instead, and that i am experiencing into ipad. I will try to resolve with some imagination if nobody can help, because he have a MAC pc, and is able to see on browser what's going wrong.
I will try to reverse anyway without a MAC. But these are moments where i really would like to have one :roll:

i will be in reply asap with all fixed. If any help or bug report in the while, it would be really appreciated
Do not take me too serious
Anyway i do not like Discourse
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

Just over, and i think i have found/reversed the problem. It is a js var containing the sid and more unwanted chars, that after make it fail the subsequent request by file ID (when click to execute the effective rotation happen) in certain conditions, because the string contains unwanted characters and not only the required INT val. I assume that is the problem into all situations, where the passed val contain these unwanted chars, that i suppose are many (like for example when it is a guest posting an image)
Going to fix, and i will return back asap!
Do not take me too serious
Anyway i do not like Discourse
mrix2000
Registered User
Posts: 1280
Joined: Sun Dec 03, 2006 2:23 pm

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by mrix2000 »

Huge thanks for the continued support and development of this EXT.
User avatar
axe70
Registered User
Posts: 751
Joined: Sun Nov 17, 2002 10:55 am
Location: Italy
Name: Alessio

Re: [3.2][3.3][RC] Attachments images rotation extension - dev/bugs logs

Post by axe70 »

Here we go lovely people!

1.0.4.2 released
https://github.com/axew3/phpBB-image-at ... s-rotation

What it fix in short:
- correctly manage attach rotation when the post is a new post/topic
- correctly display into any tested browser (ipad iOS any browser) the image on popup and correctly manage the attachment panel rows
- substantially should fix all and any reported bug.

To update, just download and replace/overwrite files with news of the 1.0.4.2 release.
Or just overwrite the two changed, which are:

/ext/w3all/imageattachrotation/styles/prosilver/template/event/overall_footer_body_after.html
and
/ext/w3all/imageattachrotation/core/fileRotate.php

NOTE that you'll have to recompile phpBB
Recompile stale style components
under Server Configuration -> Load settings


Done.

What it was wrong on 1.0.4.1 and what it fix 1.4.0.2?

Mainly two things:
1) when rotation was done into a file of a new post/topic it was failing.
Now this is fixed, so even when the rotation happen into a new topic and not into an edited one, it will be correctly processed.
2) some javascript code errors (not detected nor coming out into any browser, for example in windows) and regexp returning different result if executed on different OS/browsers

examples:

Code: Select all

var attachID = attach.src.split('id='); // not correctly working when sid appended
v = pu.replace(/id\=[0-9]+/gi, 'id='+fnew_id); // not correctly working when sid appended
this function instance

Code: Select all

// change data-attach-id to the actual one and build his new object
  $( "tr.attach-row[data-attach-id=\'"+fid+"\'" ).each(function () {
was lacking the closing ], leading to error for example on iOS ipad (all browsers)

Code: Select all

// change data-attach-id to the actual one and build his new object
  $( "tr.attach-row[data-attach-id=\'"+fid+"\']" ).each(function () {
Enjoy! ... and report bugs if still there are!
Do not take me too serious
Anyway i do not like Discourse

Return to “Extensions in Development”