? ? Pending

User tests: Successful: Unsuccessful:

avatar tonypartridge
tonypartridge
28 Jun 2021

Summary of Changes

Added a config option for always counting 404 hits - default value is off

Testing Instructions

Test hit count without applying change, you will see it only counts when the redirect/404 is unpublished.
Test with changes, the above should still be the same
Test saved with it turned off, above should be the same
Test with it turned on, the count of the 'Redirect' will always increase when hit.

This is a handy feature to track how often the 404 is actually hit still.

avatar tonypartridge tonypartridge - open - 28 Jun 2021
avatar tonypartridge tonypartridge - change - 28 Jun 2021
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 28 Jun 2021
Category Administration Language & Strings Front End Plugins
avatar brianteeman
brianteeman - comment - 28 Jun 2021

Before anyone says "no new features" this really is a bug fix

avatar tonypartridge
tonypartridge - comment - 28 Jun 2021

Thanks @brianteeman I thought so too, but as I added a config option I felt I should declare it as a feature. I was surprised it didn't continue to track once published.

avatar tonypartridge tonypartridge - change - 28 Jun 2021
Labels Added: ? ?
avatar HLeithner
HLeithner - comment - 29 Jun 2021

Shouldn't be an option, instead it should always count

avatar tonypartridge
tonypartridge - comment - 29 Jun 2021

If I can get confirmation people are happy for me to do it as default I’ll
remove the option and just always count.

It was my assumption it should always count, but at the same time I
appreciate it’s a function change to a point.

On Tue, 29 Jun 2021 at 21:24, Harald Leithner @.***>
wrote:

Shouldn't be an option, instead it should always count


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#34640 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAKWBFRPJV4QCMKB24XZMVLTVITZLANCNFSM47NUS6HA
.

--
Tony Partridge
Xtech Web Services Ltd

Managing Director/Developer

avatar Quy
Quy - comment - 30 Jun 2021

Please see PR #27440.

avatar tonypartridge
tonypartridge - comment - 30 Jun 2021

Thanks Quy, seems like no one could agree on what to do 😫

Another option is we add a separate hits counter and column called Redirect
hits.

This would fall under new feature I feel. If I can get enough agreement
this would be accepted I’ll happily code it in.

Many thanks
Tony

On Wed, 30 Jun 2021 at 11:18, Quy @.***> wrote:

Please see PR #27440 #27440.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#34640 (comment),
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAKWBFXJ5TZ6LO3IGA3LOITTVLVPPANCNFSM47NUS6HA
.

--

avatar tonypartridge tonypartridge - change - 25 Aug 2021
Labels Added: Language Change ?
Removed: ? ?
avatar joomla-cms-bot joomla-cms-bot - change - 25 Aug 2021
Category Administration Language & Strings Front End Plugins Front End Plugins
avatar tonypartridge tonypartridge - change - 25 Aug 2021
Labels Removed: Language Change
avatar tonypartridge
tonypartridge - comment - 25 Aug 2021

Now updated to just always count, as Brian and HLeithber agreed this should also happen by default..

avatar zero-24 zero-24 - test_item - 18 Sep 2021 - Tested successfully
avatar zero-24
zero-24 - comment - 18 Sep 2021

I have tested this item successfully on ed75f34

Looks good to me thanks!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34640.

avatar pabloarias pabloarias - test_item - 1 Oct 2021 - Tested successfully
avatar pabloarias
pabloarias - comment - 1 Oct 2021

I have tested this item successfully on ed75f34

Tested on Joomla 3.10.3-dev.

Thank you and best regards


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34640.

avatar alikon alikon - change - 1 Oct 2021
Status Pending Ready to Commit
avatar alikon
alikon - comment - 1 Oct 2021

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/34640.

avatar bembelimen
bembelimen - comment - 5 Oct 2021

Mhh, in general I agree with this PR, but when the saving failed, should we really kill the redirect just because the saving of the hit counter does not work?

avatar tonypartridge tonypartridge - change - 23 Nov 2021
Labels Added: ?
avatar tonypartridge
tonypartridge - comment - 23 Nov 2021

updated as requested.

avatar tonypartridge
tonypartridge - comment - 23 Nov 2021

I literally just copied the original method to avoid issues.

If we want to adjust how Joomla! Does it natively then we can do that as a whole opposed to a bit her and a bit there on PRs?

--
Sent from Canary (https://canarymail.io)

On Tuesday, Nov 23, 2021 at 11:31 am, Phil E. Taylor @.*** @.***)> wrote:

@PhilETaylor commented on this pull request.

In plugins/system/redirect/redirect.php (#34640 (comment)):

@@ -285,6 +285,17 @@ private static function doErrorHandling($error) // In case the url contains double // lets remove it $destination = str_replace(JUri::root() . '/', JUri::root(), $dest); + // Always count redirect hits + $redirect->hits++;
⬇️ Suggested change

  • $redirect->hits++; + ++$redirect->hits;

Im not sure about others, but incrementing on a line by its own, I have always used the pre and not post version of ++ (Yes I understand the difference, and yes, its probably ok this way

Looking at more professional projects and they use ++$value

Joomla has both versions, and its not documented in the coding standards, except by accident in the A do-while Example


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#34640 (review)), or unsubscribe (https://github.com/notifications/unsubscribe-auth/AAKWBFUS5B7ALTZKT7AEPILUNN3SFANCNFSM47NUS6HA).

avatar PhilETaylor
PhilETaylor - comment - 23 Nov 2021

If we want to adjust how Joomla! Does it natively then we can do that as a whole opposed to a bit her and a bit there on PRs?

Joomla has repeatedly rejected such PR's that seek to make code style changes throughout the code base :) Like I said before deleting, its not an issue, and as this is already RTC it can stay. Although:

This branch is out-of-date with the base branch

^^ that needs addressing before it can be merged.

avatar tonypartridge
tonypartridge - comment - 6 Dec 2021

Thanks, Phil. I have now merged changes.

avatar zero-24 zero-24 - change - 5 Jan 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-01-05 19:29:22
Closed_By zero-24
avatar zero-24 zero-24 - close - 5 Jan 2022
avatar zero-24 zero-24 - merge - 5 Jan 2022
avatar zero-24
zero-24 - comment - 5 Jan 2022

Merging here thanks :)

Add a Comment

Login with GitHub to post a comment