Afrodude
-
Posts
910 -
Joined
-
Days Won
7
Reputation Activity
-
Afrodude reacted to Andreas Grace in PHP 8.2 Thread
As a matter of principle, PHP 8.2 should be supported officially for v4 in the next months. PHP 8.1 is already in security-only support and that expires on 25 Nov 2024.
-
Afrodude reacted to David N. in Profile: "Last Visited" should state "online now" when user is online
Last Visited should state "Online Now" when a user is still online (the same way the hover card currently displays it).
The way it works now is a bit odd, as mentioned in the following threads:
-
Afrodude reacted to David N. in [Bug] Last Visited
Yes, I read what @Matt wrote.
I understand the technical reason behind the behavior. I also agree with Matt that it looks odd (to say the least), and I am hoping that a better solution can be implemented.
IMO the profile page should say "online now" until the user's session times out. I don't suppose there should be a privacy concern since we can already see "online now" in the user's hover card anyway?
-
Afrodude reacted to David N. in [Bug] Last Visited
I am also seeing this in my community, for example a user last visited 33 minutes ago but posted 9 minutes ago.
Or here's another example:
-
Afrodude reacted to David N. in User last visited 32 minutes ago (and yet posted 8 minutes ago)?
Turns out it's not a cache issue; the issue was reported before there:
-
Afrodude got a reaction from David N. in [Bug] Last Visited
Last visit was 20 minutes ago
at 05:52 AM
Home come he manage to post a reply after 10 minutes from his last visit while he was already away!!!!?????
-
Afrodude reacted to teraßyte in REST API /cms/records/{databaseId} POST fails with 500 in 4.7.16
Looking again at the screenshot, the error is being thrown when a revision for the record is added to the database, not when the record itself is added. If you're adding a new record, it shouldn't store a revision. A revision should be saved only when you edit a record.
The problem is in /applications/cms/api/records.php in the _createOrUpdate() function (lines 424-443):
/* Store a revision before we change any values */ if ( $item::database()->revisions ) { $revision = new \IPS\cms\Records\Revisions; $revision->database_id = $item::$customDatabaseId; $revision->record_id = $item->_id; $revision->data = $item->fieldValues( TRUE ); if ( $this->member ) { $memberId = $this->member->member_id; } else { $memberId = $item->author()->member_id; } $revision->member_id = $memberId; $revision->save(); }
The IF check should also check if you're editing a record because when adding a new one there is no record ID available yet (thus the column NULL error):
if ( $type == 'edit' AND $item::database()->revisions ) -
Afrodude reacted to teraßyte in Error when creating CMS record via REST API
It's indeed the same issue.
I posted a fix here if you can't wait for IPS to fix it in the next (?) version:
-
Afrodude reacted to teraßyte in [BUG 4.7.16] The s3Delete task is not activated correctly when deleting an Amazon S3 container
In the file /system/File/Amazon.php inside the function deleteContainer() this code is executed when adding a new delete task to delete the files in a bucket folder (container):
/* Turn on task */ \IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 1 ), array( '`key`=?', 's3_delete' ) ); The problem is that the task's key is not s3_delete but s3Delete (no space + capitalized). This causes the task to delete the S3 files to not activate correctly.
The same issue is also present inside the code of the s3Delete task to disable itself in 2 different locations.
Lines 44-50:
if ( !( $obj instanceof \IPS\File\Amazon ) ) { /* Class is not Amazon, so just stop here and truncate the table as there's nothing we can really do now. */ \IPS\Db::i()->delete( 'core_s3_deletions' ); \IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 's3_delete' ) ); return NULL; } Lines 96-97:
/* Nothing to do, so switch off the task */ \IPS\Db::i()->update( 'core_tasks', array( 'enabled' => 0 ), array( '`key`=?', 's3_delete' ) );
Again s3_delete is being used instead of s3Delete.
-
Afrodude reacted to Marc Stridgen in Issues with blogs
This has been added as feedback as a suggestion to change. If you are reporting something you believe to be a bug, you should report this in our technical problems area. Feedback, while read, will not always be responded to.
In the case of this one, it appears to be a suggestion for change in the software in multiple areas. I would highly suggest ensuring you are adding each suggestion as a separate item, as this appears to start with URLs, go to slideshows and end with tags
With suggestions, we cannot guarantee that an item will be added or changed when you post. We can guarantee only that its read and may be considered. What we can certainly guarentee is if they are not posted, we wouldnt even know you wish to have them of course
-
Afrodude reacted to WebCMS in Issues with blogs
Would appreciate if someone confirms that these issues have been added to your bug model; otherwise, all that testing, recording issues and reporting issues would be for nothing.
-
Afrodude reacted to teraßyte in Invision Community 5: Assign topics to moderators
I don't think normal members will be able to see that someone is assigned to the topic. I might be wrong, though. 🙄
-
Afrodude reacted to teraßyte in Where are Followers of a Member stored?
The data is in the core_follow table. They need to filter by:
follow_app=core follow_area=member follow_rel_id=XXX (where XXX is the member ID) -
Afrodude reacted to Kirill Gromov in Bug with rating
Hello, I gave this topic a 5 rating. If you hover the cursor over a rating and move the cursor away, the rating does not return to its original value.
In the ips.ui.rating module there is a line:
.find('li[data-ratingValue="' + value + '"]') Here value is searched as an integer, but in the code it is a floating number (5.0)..
<div data-ipsrating="" data-ipsrating-changerate="true" data-ipsrating-size="veryLarge" data-ipsrating-value="5.0" data-ipsrating-userrated="5">
-
Afrodude reacted to SeNioR- in HTML syntax error in the "whosOnline" template
EDIT: replacing div with span solves the error.
<div class='ipsFlex ipsFlex-jc:between ipsFlex-fw:wrap ipsFlex-ai:center'> to
<span class='ipsFlex ipsFlex-jc:between ipsFlex-fw:wrap ipsFlex-ai:center'> -
Afrodude reacted to teraßyte in [BUG 4.7.16] Incosistent implementation of core extension "EditorLocations::attachmentLookup()"
As per the title, the implementation of the extension's EditorLocations::attachmentLookup() method is inconsistent when you don't allow attachments. No matter how I implement it, or which exception I throw, it won't work for all locations.
1) \applications\core\extensions\core\EditorMedia\Attachment.php (lines 140-156):
The code checks if the method exists before calling it. The code checks for 2 exceptions being thrown: \LogicException \BadMethodCallException if( method_exists( static::$loadedExtensions[$map['location_key']], 'attachmentLookup')) { try { $url = static::$loadedExtensions[$map['location_key']]->attachmentLookup($map['id1'], $map['id2'], $map['id3']); /* Test url() method to prevent BadMethodCallException from the template below - an attachment may be located within a Node class that doesn't support urls, such as CMS Blocks. */ if ($url instanceof \IPS\Content or $url instanceof \IPS\Node\Model){ $url->url(); } static::$locations[$attachId][] = $url; } catch (\LogicException $e) { } catch (\BadMethodCallException $e) { } }
2) \applications\core\modules\admin\overview\files.php (lines 209-219):
The code checks if the method exists before calling it. The code checks for a single exception being thrown: \LogicException if ( isset( $loadedExtensions[ $map['location_key'] ] ) AND method_exists( $loadedExtensions[ $map['location_key'] ], 'attachmentLookup' ) ) { try { if ( $url = $loadedExtensions[ $map['location_key'] ]->attachmentLookup( $map['id1'], $map['id2'], $map['id3'] ) ) { $locations[] = $url; } } catch ( \LogicException $e ) { } }
3) \applications\core\modules\front\system\attachments.php (lines 87-100):
The code doesn't check if the method exists before calling it. The code checks for a single exception being thrown: \OutOfRangeException /* Check Permission */ $exploded = explode( '_', $attachment['location_key'] ); try { $extensions = \IPS\Application::load( $exploded[0] )->extensions( 'core', 'EditorLocations' ); if ( isset( $extensions[ $exploded[1] ] ) ) { $attachmentItem = $extensions[ $exploded[1] ]->attachmentLookup( $attachment[ 'id1' ], $attachment[ 'id2' ], $attachment[ 'id3' ] ); } } catch ( \OutOfRangeException $e ) { \IPS\Output::i()->json( array( 'error' => 'no_permission' ) ); }
4) \system\Content\Statistics.php (lines 398-408):
The code doesn't check if the method exists before calling it. The code checks for a single exception being thrown: \LogicException \BadMethodCallException if ( isset( static::$loadedExtensions[ $map['location_key'] ] ) ) { try { $url = static::$loadedExtensions[ $map['location_key'] ]->attachmentLookup( $map['id1'], $map['id2'], $map['id3'] ); $return[ $k ]['commentUrl'] = (string) $url->url(); } catch ( \LogicException $e ) { } catch ( \BadMethodCallException $e ){ } }
===
To make a summary of the implementations:
All OK. It should check for the \BadMethodCallException exception. It should check if the method exists before calling it, and both \LogicException and \BadMethodCallException exceptions aren't being checked. Rather, it checks for a \OutOfRangeException exception which is never thrown according to the method's phpDoc. It should check if the method exists before calling it.
I could throw a \LogicException, but as it is it would break implementation #3 anyway.
-
Afrodude reacted to Steven W. in [CMS App] Database Record Downloads
I've found the database app an interesting tool to build on. Oddly, there is no ability to download records. I thought about why this might be and looked at the database. Is it because the cms_custom_database_n tables use the custom database field id in the column names instead of using the custom database field's field_key value?
This block in applications/cms/sources/Fields/Fields.php would need to be updated to replace hyphens with underscores:
if ( \is_array( $values['field_title'] ) ) { /* We need to make sure the internal pointer on the array is on the first element */ reset( $values['field_title'] ); $values['field_key'] = \IPS\Http\Url\Friendly::seoTitle( $values['field_title'][ key( $values['field_title'] ) ] ); } else { $values['field_key'] = \IPS\Http\Url\Friendly::seoTitle( $values['field_title'] ); }
-
Afrodude reacted to beats23 in Help!! I can't update to the latest version. There are no applications available to upgrade
In my book, the latest is always the best. Someone has to be the guinea pig for the rest or there will be a slow evolution. I'll be installing IPSv5 on the first day it drops🙂.
-
Afrodude reacted to teraßyte in [4.7.16 Beta 4] The CODE button in CKEditor doesn't work
Trying to use the Code button in the editor on this site throws a JS error in the browser's console:
-
Afrodude reacted to teraßyte in [4.7.15] DATE form helper bug with timezones when checking min/max date
The \IPS\Helpers\Form\Date class does not account properly for a member's timezone when the min and/or max options are set.
This is the file's code on lines 303-314 in the validate() function:
if ( $this->value and $this->options['min'] !== NULL and $this->options['min'] > $this->value ) { $string = $this->options['min']->setTimeZone( $timezone )->localeDate( \IPS\Member::loggedIn() ); if( $this->options['time'] ) { $string .=' ' . $this->options['min']->setTimeZone( $timezone )->localeTime( \IPS\Member::loggedIn() ); } throw new \LengthException( \IPS\Member::loggedIn()->language()->addToStack('form_date_min', FALSE, array( 'sprintf' => array( $string ) ) ) ); } /* Check maximum */ if ( $this->value and $this->options['max'] !== NULL and $this->options['max'] < $this->value ) { $string = $this->options['max']->setTimeZone( $timezone )->localeDate( \IPS\Member::loggedIn() ); if( $this->options['time'] ) { $string .=' ' . $this->options['max']->setTimeZone( $timezone )->localeTime( \IPS\Member::loggedIn() ); } throw new \LengthException( \IPS\Member::loggedIn()->language()->addToStack('form_date_max', FALSE, array( 'sprintf' => array( $string ) ) ) ); }
The code doesn't account at all for the timezone when checking the min/max values against the entered value:
$this->options['min'] > $this->value $this->options['max'] < $this->value The timezone is added only inside the IF check to display the error, but not before it for the check:
$string = $this->options['min']->setTimeZone( $timezone )->localeDate( \IPS\Member::loggedIn() ); $string = $this->options['max']->setTimeZone( $timezone )->localeDate( \IPS\Member::loggedIn() );
This causes the check to fail for a user close to the UTC timezone, while it passes for a user with a more distant timezone.
Here is an example with 2 different timezones (Rome & New York):
DEBUG CODE: ================================================== print_r( $this->value ); print_r( $this->options['min'] ); print_r( $this->options['min']->setTimeZone( $timezone ) ); var_dump( $this->options['min'] > $this->value ); exit; ================================================== OUTPUT FOR ROME TIMEZONE: ================================================== IPS\DateTime Object ( [date] => 2024-03-02 00:01:00.000000 [timezone_type] => 3 [timezone] => Europe/Rome ) IPS\DateTime Object ( [date] => 2024-03-02 00:58:41.440303 [timezone_type] => 3 [timezone] => UTC ) IPS\DateTime Object ( [date] => 2024-03-02 01:58:41.440303 [timezone_type] => 3 [timezone] => Europe/Rome ) bool(true) ================================================== OUTPUT FOR NEW YORK TIMEZONE: ================================================== IPS\DateTime Object ( [date] => 2024-03-02 02:41:00.000000 [timezone_type] => 3 [timezone] => America/New_York ) IPS\DateTime Object ( [date] => 2024-03-02 00:52:00.648474 [timezone_type] => 3 [timezone] => UTC ) IPS\DateTime Object ( [date] => 2024-03-01 19:52:00.648474 [timezone_type] => 3 [timezone] => America/New_York ) bool(false)
As you can see from the debug output above, the member with a Rome timezone fails to pass the check (TRUE triggers the error), while the New York timezone passes the check (FALSE doesn't trigger the error).
The timezone must be added to the min/max checks before the check is done, and not after to display only the error.
-
Afrodude reacted to Steven W. in Speed Optimization: Embedded Iframes
I'm not sure if this has ever been implemented for some iframes, because the core -> global -> embed -> iframe template also doesn't have this, and is not related to the YouTube embed:
<div class='ipsEmbeddedOther' contenteditable="false"> <iframe src="{$url|raw}" data-controller="core.front.core.autosizeiframe" {{if $embedId}}data-embedId='{$embedId}'{{endif}} allowfullscreen=''></iframe> </div> The same is true for Google Maps core -> global -> embed -> googleMaps:
<div class='ipsEmbeddedOther' contenteditable="false"> <iframe height="450" {{if $mapType == 'place'}} src="https://www.google.com/maps/embed/v1/place?key={setting="google_maps_api_key"}&q={$q}" {{elseif $mapType == 'dir'}} {{if isset( $q['waypoints'] )}} src="https://www.google.com/maps/embed/v1/directions?key={setting="google_maps_api_key"}&origin={$q['origin']}&waypoints={$q['waypoints']}&destination={$q['destination']}" {{else}} src="https://www.google.com/maps/embed/v1/directions?key={setting="google_maps_api_key"}&origin={$q['origin']}&destination={$q['destination']}" {{endif}} {{elseif $mapType == 'search'}} src="https://www.google.com/maps/embed/v1/search?key={setting="google_maps_api_key"}&q={$q}" {{elseif $mapType =='coordinates'}} src="https://www.google.com/maps/embed/v1/view?key={setting="google_maps_api_key"}¢er={$q}&zoom={$zoom}" {{endif}}> </iframe> </div> As well as Brightcove videos core -> global -> embed -> brightcove:
<div class="ipsEmbeddedBrightcove"> <div class="ipsEmbeddedBrightcove_inner"> <iframe src="{$url|raw}" allowfullscreen webkitallowfullscreen mozallowfullscreen class="ipsEmbeddedBrightcove_frame"> </iframe> </div> </div> The plugin I made lazy loads all of these iframes.
-
Afrodude reacted to Adlago in Uses deprecated APIs ...
Judging by my quoted post from 2020, should we expect a change in 2028?😇
-
Afrodude reacted to MartinLawrence in Help with Zapier!
I basically got a F you when asking for my money back. They told me they could not refund me because there was usage on my account - usage caused by their support staff!
I never had a single zap work.
-
Afrodude reacted to Callum MacGregor in Concern re deprecation of Support requests
Yeah, until they scrap pages too 😄
-
Afrodude reacted to teraßyte in [v5 REQUEST] Implement extension functions more consistently
On another note, the preSave function is not even included in the file added by the developer center when you add the extension from ACP. That's another thing that should be double-checked: update example files with all available functions and clearly indicate which ones are required.
EDIT
Nevermind, I actually mixed up ModeratorPermissions with ContentModeratorPermissions (that doesn't support preSave). It's still something that should be double-checked for all extensions anyway.