getURL( ) function of an entity returns IP address instead of DNS name

I have been testing my Elgg3.2 site after upgrading it from my production site (Elgg2.3.7). I overwrote the notification hooks ie. blog. Below is my code in my custom plugin.

elgg_unregister_plugin_hook_handler('prepare', 'notification:publish:object:blog', 'blog_prepare_notification');

elgg_register_plugin_hook_handler('prepare', 'notification:publish:object:blog', 'blog_custom_notification');

function blog_custom_notification (\Elgg\Hook $hook) {

   $entity = $hook->getParam('object');

   $url = $entity->getURL( );

   .....

}

My question is why $url returns https://<ip address>/blog/view/<entity guid>/<blog title> instead of https://<dns name>/blog/view/<entity guid>/<blog title>.

Below is how I upgraded from Elgg2.3 to Elgg3.2 (if this helps in debugging).

- Got my production site to work on my test environment first including database and data directory

- In my wwwroot directory, I ran:

   1. composer self-update

   2. composer require elgg/elgg:~3.2.2

   3. composer update

   4. vendor/bin/elgg-cli upgrade async -v

Thanks for your help as always.

 

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking