Jump to content

BN_IT_Support

Clients
  • Posts

    1,831
  • Joined

  • Last visited

  • Days Won

    3

BN_IT_Support last won the day on July 18 2016

BN_IT_Support had the most liked content!

5 Followers

Profile Information

  • Gender
    Male

Recent Profile Visitors

27,661 profile views

BN_IT_Support's Achievements

  1. Hello, We have quite a lot of pages so I have not tested this exhaustively - i.e. not against EVERY page, but... From the large number of pages that I have checked: It appears that the Loader (extension) method onFinish() is called for non-database pages -- OK !! It appears that the Loader (extension) method onFinish() is NOT called for database pages -- BUG !! When I say "database pages" I mean go to the ACP and list all pages. Those pages that have the text "Contains database <db name>" I refer to as "database pages". My onFinish() method starts like this: public function onFinish() : void { // nothing to do if location != 'front' if (!\IPS\Dispatcher::i()->checkLocation('front')) { return; } $member = \IPS\Member::loggedIn(); \IPS\Log::log("Member: {$member->name}, {$member->login}, " . var_export($member->groups, true) . ", {$_SERVER['REQUEST_URI']}"); non-database pages give me output in the system log, database pages don't. Thanks, John
  2. Esther, Sorry - my mistake. My review listener already handled the event so did not log it - accordingly, I erroneously presumed that the listener had not seen the event. 'Not a bug'! Thanks. John
  3. Hello, "Adding a review to gallery/Album unexpectedly fires Comment Listener rather than expected Review Listener!" I have both a review listener: /** * @brief [Required] The class that is handled by this listener * @var string */ public static string $class = \IPS\Content\Review::class; And a comment listener: /** * @brief [Required] The class that is handled by this listener * @var string */ public static string $class = \IPS\Content\Comment::class; But only the comment listener gets fired when a review is added to a gallery Album. Thanks. John
  4. Hello, I don't really have a lot of information on this one (sorry!!). I received an email telling me that there had been a cron failure . I could not see anything useful in it!! <body> <div id='error'> <h1>An error occurred <span>(500 Error)</span></h1> <div id='content'> We're sorry, but a temporary technical error has occurred which means we cannot display this site right now. <br><br> You can try again by clicking the button below, or try again later. <br><br> <button onclick="window.location.reload();" id='reload_button'>Try again</button> </div> </div> </body> I then looked through the System log for the time of the email and found the following (which seems to match the cron failure). Error: Call to undefined method IPS\core\extensions\core\IpAddresses\Content::pruneIpAddresses() (0) #0 /home/bn2468/public_html/applications/core/tasks/pruneipaddresses.php(51): IPS\Member::pruneAllLoggedIpAddresses() #1 /home/bn2468/public_html/system/Task/Task.php(343): IPS\core\tasks\pruneipaddresses->execute() #2 /home/bn2468/public_html/system/Task/Task.php(306): IPS\Task->run() #3 /home/bn2468/public_html/applications/core/interface/task/task.php(78): IPS\Task->runAndLog() #4 {main} I hope it makes more sense to you than it does to me. John
  5. Marc, Thanks for your reply, but I believe that you are wrong... Your response to someone else was with reference to "feeds" and they work differently. As your response to the someone else said, you can configure feeds in many different ways. The issue is that the pagebuilderupload widget does not work correctly and is not properly configurable in the way that you describe for feeds. Of course, I get it that V5 is different. Let's consider two types of changes and the IMPACT ON DOWN TIME when I upgrade a live website... Changes which require code changes to our plugins and applications. Basically, if we are able to change the plugin or application to work with V5 on our test system then the additional downtime to the live site when we upgrade it is minimal... When we do the upgrade from V4 to V5 we have to accept an amount of downtime for the upgrade, but the additional downtime of re-installing an updated application is only a minute or two (typically). Changes which require us to redesign pages during the upgrade... Of course, we can test the redesign changes that are required and can test them on the test system so that we know what we have to do during the upgrade of the live system. But, when we end up with a long list of pages and other changes that we must make manually after doing the upgrade then it takes a long time so we effectively have a much longer down period. Because the V5 pagebuilderupload widget does not work correctly that leaves us with two issues when it comes to upgrading our live system to V5: You are pushing us into extended downtime during the upgrade because we have to manually go into each page and modify it. (I'm not even sure what the solution would be at this time, but whatever the solution it is going to take time to make manual changes to the widgets, layout, whatever...) The feeds that you told the <someone else> about do not do what we want... (Of course, they are very nice when you want what they do!) Among other things, the feeds display additional information that we do not want to have displayed. For security reasons we do not want the author name or other details displayed and there may well be other information that we do not want in the display. Thanks, John
  6. Hello, I create a Wizard page and add the Images widget - doing the same on both V4 and V5 for comparison. Upload 6 images Set 6 captions Set 6 URLs Set max height to 300 Add custom CSS to add a border and the banner text line On V4 on a wide screen (desktop/PC) this looks fine: On V5 this will only show one image at a time - along with messy background either side: Thanks, John
  7. Hello, Developing my own widget (extends \IPS\Widget implements \IPS\Widget\Builder) - there is an ACP option to select the "menu style" as either "Pop-up menu" or "modal". "Modal" works fine 😉 "Pop-up menu" has (at least) two issues: Advanced=>Custom CSS: does not work. You can edit the CSS (latest Firefox) and put whatever you want. When you click save no errors are reported but the Custom CSS is just silently "lost" - it has no effect and when you go back into the settings all your input has vanished from the "Custom CSS" box. Other settings (e.g. "Box border" are saved as you would expect. Pop-up menu is basically a mess: Too narrow Fields for both 'Settings' and 'Advanced' tab appear on the same popup as soon as you open the editor to change the settings Click the 'Visibility' tab and it show the fields for both Visibility and Advanced Thanks. John
  8. Hello, If you create a widget in the ACP then you get a new widget PHP file with an init() method and nice comments about how to override the default template name and location. Admittedly, the comments are not explicit but as they are placed prior to the call to parent::init() there is a clear implication that the template should be specified BEFORE calling parent::init(). That's what I did and it does not work... Quick inspection of the Widget class shows that the only thing done in parent::init() is to set the default template so, obviously, the template must be specified AFTER the call to parent::init() if one wants to override the default template. Thanks. John
  9. Esther, Thanks for the response... Fair enough! Now, that's interesting... Will you be including "first Sunday of month", "last Sunday of month" (which might be 4th or 5th depending upon the number of Sundays in the month), "3rd Sunday of month" and other variations on those themes? Thanks. John
  10. Hello, To reproduce the problem: Create an event: NOT "single day" - for example, event starts on 13th Jan and ends on 17th Jan All day Not recurring In event "day view" select 15th Jan - the event does not show even though it is actively running on that day. The event should show in event view on all days from 13th to 17th Jan inclusive. Click to show details of the event would then obviously state that it started on 13th and runs until 17th. Thanks. John
  11. Hello, To reproduce the problem: Create an event that repeats every Sunday. I created an event on 5th Jan 2025 for 10:00-12:00 and set it to repeat every Sunday. View the calendar (e.g. month view) and the event correctly shows as repeating. Hover over one of the repeats (19th or 26th or whatever) and the date of the event shows up correctly. OK so far! Click one of the repeats - for example, 26th Jan. The date of the event now incorrectly shows as 5th Jan. The above is the detail for the event on 26th Jan 2025. As you can see, the date is given as 5th Jan which is incorrect. 5th Jan is (of course) the start date for the repeating sequence - but we don't need that as it is repeating the information shown on the next line (underlined) where it states the start date and the details of the repeat. Our users complain about this behaviour. They expect the correct date to be displayed - that is the date of the calendar entry that they clicked. Thanks. John
  12. Daniel F, Thanks for your response - but I believe that will not work. The whole point is that the request to Google Maps API is being made from the browser under V5 and not from the server. (Presumably, under V4 the request was being made from the server so your advice would have worked.) The browser of "mr/mrs hacker" is not in our server's domain so if we did what you advise then they would be blocked. Unfortunately, the browsers of all our members are also not in our server's domain so they would also be blocked. Following your advice, I'm not sure how that differs from disabling Google Maps for all users? John
  13. Hello, Serious issue here - we would be unable to upgrade to V5 with this security hole in existence. In month view of the calendar (/events/2025/1/, for example) if we hover the cursor over an event then a popup occurs which displays the event detail and a Google Map. Superficially, this appears to be the same as under V4 - so OK, so far - superficially! But, when I use the browser developer tools to monitor network traffic I get the following "GET https://maps.googleapis.com/maps/api/staticmap?center=Rochester, Kent&size=300x200&markers=Rochester, Kent&key=<our-no-longer-secret-key>&scale=1&maptype=roadmap" Note - this is the developer tools in the browser - not the Invision server - so any member, guest or hacker can steal our secret key from our V5 site. Of course, I went into "blind panic mode" worrying that we could have been exposing our secret key under V4 - but luckily this appears to be a new defect under V5 as I could not see our secret key being exposed under V4. Thanks. John
  14. Hello, Google Maps charge for making API calls - so it is obviously prudent to minimise the number of API calls that are made. (I appreciate that Google Maps has a free monthly quota but we exceed that so end up paying -- in any case, making 3 times as many calls as needed exhausts the free quota more quickly so we start paying sooner and also we end up paying 3 times what is necessary...) At this time, I have only checked the code for Calendar/Events, but I suspect that everywhere else that has maps will have the same or a similar issue... "eventSidebar.phtml" (for example) has the following three calls to generate the map: {{if $address || $event->map( 500, 500 )}} <div data-ips-hook="mapWrapper" class='ipsBox ipsPull'> {{if $event->map( 500, 500 )}} <div data-ips-hook="map" class='cEvents__sidebarMap'> {$event->map( 500, 500 )|raw} </div> {{endif}} {{if $event->venue || $address}} <div data-ips-hook="venueWrapper" class='i-padding_3'> {{if $event->venue}} <div data-ips-hook="venue" class=''> <h3 class='ipsMinorTitle'> <strong>{lang="event_venue_name"}</strong> </h3> {lang="calendar_venue_{$event->venue()->id}" escape="true"} </div> {{endif}} {{if $address}} <div data-ips-hook="address">{$address|raw}</div> {{endif}} </div> {{endif}} </div> {{endif}} (OK - so, I admit that in practice it probably reduces to only 2 calls because if a map can be generated then there is almost certainly an address so the first call does not actually occur 😉) $event->map() calls GeoLocation::buildFromJson which returns a new instance and rendering of the map so (as far as I can see) the map is rendered 2 or 3 times when once would do ... Although it would not be the solution that I would want, if you at least hold the rendered map inside the $event object and return that help map on each call to $event ->map() then the unnecessary calls to Google Maps would be avoided. Note: this is not the same as caching the rendered map to disk so it should not breach the Google Maps terms and conditions. I believe the above describes the bug... The following is an additional point that would potentially solve a problem for me... Because of the cost of thousands of lookups to the Google Maps API what I actually need is some way for me to control the number of actual lookups and also return alternative data. For example, if someone is quickly browsing many events then there could be many map renderings in a short period of time - so one thing that I would want to do is rate limit map rendering - either on an individual member basis or perhaps on a server wide basis (most likely the former, but that could depend upon Executive Committee decisions). If I were to implement rate limiting then once the limit has been hit I would want to display an alternative image with a snippet of text to explain what has happened and why. I did start to look at the above because I was hoping to find a way to use a "data-ips-hook" to achieve what I needed - but this falls down for two (at least) main reasons: {{if $address || $event->map( 500, 500 )}} occurs before the hook so the Google Maps API call could have occurred before I have any chance to take action There is no way to choose when to render a map or not... Of course, we can set which groups can see maps so we can block (non-paying) guests from seeing a map so that only (paying) members get to see maps - but that is not dynamic - a particular member can either always see maps or never see maps and we cannot choose on a lookup by lookup basis as part of rate limiting. So what I would really like - what I think could provide a solution to my problem - is to have a listener/extension for maps. We would need at least two functions: "proceedWithApiCall()" - returns bool - would be called from Invision GeoLocation and Map functions to decide whether to proceed and make API calls. Our software would return "true" for proceed or "false" to not make any API calls. "alternativeImage()" - returns an alternative image to display - perhaps a static outline of the country or a globe or something and probably with a message explaining that rate limiting has occurred - for example. Thanks very much, John
×
×
  • Create New...