A minor issue that I observed

melo lobo Posted in Component Development 5 months ago

I hope this message finds you well. I wanted to bring to your attention a minor issue that I observed, which, while not critical, I believe is worth noting.
In principle, when all components are deactivated (even though it may not make practical sense), the website should continue to function. However, I noticed that when all components are disabled, the site does not operate as expected, and error messages are displayed—unless the OssnGiphy component is activated. It appears that, contrary to expectations, OssnGiphy needs to remain active for the system to function properly when all other components are disabled.
It is noteworthy that when only OssnGiphy is deactivated while the other components are active, the site functions correctly.
I thought it was essential to bring this to your attention, as it deviates from the expected behavior. Your assistance in investigating and resolving this matter would be greatly appreciated.
(On free version)

Replies
ma Melo lobo Replied 5 months ago

The intention behind this action was not to render the components useless; on the contrary, it was an effort to test the modularity of the site.

The idea is to ensure that each part of the site functions independently of the others. By deactivating the components, I aimed to assess the site's ability to operate seamlessly even when certain features are temporarily disabled.

Considering the potential of OSSN, why not use it as a robust foundation for the development of our sites, customizing the output with components tailored to our specific needs?

OSSN provides a sturdy structure that can serve as a reliable groundwork, and by developing bespoke components, we could not only optimize our current sites but also explore possibilities for distinctive rendering. This approach would enable us to leverage the flexibility of OSSN while precisely meeting our unique requirements.

German Michael Zülsdorff Replied 5 months ago

Hmm, that makes me wonder. Because with any Ossn I had so far I was never able to de-activate/delete the OssnProfile component from my admin backend.
That is: Under normal circumstances at least one entry would remain in the ossn_components table.

That being said: There is absolutely no reason for manual database changes: deleting a component the “normal” way on the administrator's components page will automatically remove both the database entry and the component's subdirectory.

ma Melo lobo Replied 5 months ago

Since I have deactivated all the components, I have also manually cleared the ossn_components table in the database.

German Michael Zülsdorff Replied 5 months ago

Well,
before going deeper into it I would like to ask:
Which REGULAR way - I mean from your admin backend - did you manage to empty the ossn_components table completely?

ma Melo lobo Replied 5 months ago

Hi Michael, I noticed this issue related to the same subject:
When the 'ossn_components' table are empty

TypeError: in_array(): Argument #2 ($haystack) must be of type array, bool given in C:\xampp\htdocs\ossn\libraries\ossn.lib.components.php:34
Stack trace:
#0 C:\xampp\htdocs\ossn\libraries\ossn.lib.components.php(34): in_array('OssnWall', false)
#1 C:\xampp\htdocs\ossn\libraries\ossn.lib.initialize.php(118): com_is_active('OssnWall')
#2 C:\xampp\htdocs\ossn\libraries\ossn.lib.page.php(79): ossn_user_pagehandler(Array, 'home')
#3 C:\xampp\htdocs\ossn\index.php(22): ossn_load_page('home', Array)
#4 {main}
ma Melo lobo Replied 5 months ago

I saw this on the website:

"Due to the many requests in the past for additional features and components, we have decided to develop a premium version. Features such as Hashtags, Videos, Polls, Events, Stories, Link Preview, etc., are included in it

Seizing this opportunity, I would like to propose the idea of creating a special version, OSSN Learning, which you can market as you see fit, as no price can truly reflect its value. This version is specifically designed for those who wish to gain a deep understanding of OSSN development. It will incorporate your development philosophy and your experiences in the field.

Some may argue that understanding OSSN requires studying languages such as PHP, JavaScript, MySQL, etc. However, I would argue that this approach is akin to teaching a child the alphabet before handing them a work by Higuel or Neitzch to understand it. They can only do so once they reach adulthood and accumulate experience in life. It is this experience that we seek and invite you to share with us.

It is important to note that the OSSN Learning version will not contain programming courses. Instead, it will offer a differentiated mapping of various parts of the OSSN engine, explaining who does what from the initialization phase to advanced stages. It will highlight the role of key functions such as addhook, callhook, triggercallback, registercallback, etc.

We believe that OSSN Learning will bring significant added value to those wishing to deepen their understanding of OSSN development, emphasizing practical experience and wisdom gained over time.

German Michael Zülsdorff Replied 5 months ago

Oh yeah! Good finding, Melo. Thanks.

Actually, the real issue appears a little different:
The current code expects at least ONE component to have configurable options ;)
The fix would be to change line #28 of system\plugins\default\admin\components\list\item.php like:

if (ossn_registered_com_panel() && in_array($params['name'], ossn_registered_com_panel())) {
ma Melo lobo Replied 5 months ago

TypeError: inarray(): Argument #2 ($haystack) must be of type array, bool given in C:\xampp\htdocs\ossn\system\plugins\default\admin\components\list\item.php:28
Stack trace:
#0 C:\xampp\htdocs\ossn\system\plugins\default\admin\components\list\item.php(28): in
array('OssnProfile', false)
#1 C:\xampp\htdocs\ossn\libraries\ossn.lib.views.php(27): include('C:\\xampp\\htdocs...')
#2 C:\xampp\htdocs\ossn\libraries\ossn.lib.views.php(50): ossninclude('C:/xampp/htdocs...', Array)
#3 C:\xampp\htdocs\ossn\libraries\ossn.lib.plugins.php(75): ossn
view('C:/xampp/htdocs...', Array)
#4 C:\xampp\htdocs\ossn\system\plugins\default\pages\administrator\contents\components.php(24): ossnpluginview('admin/component...', Array)
#5 C:\xampp\htdocs\ossn\libraries\ossn.lib.views.php(27): include('C:\\xampp\\htdocs...')
#6 C:\xampp\htdocs\ossn\libraries\ossn.lib.views.php(50): ossninclude('C:/xampp/htdocs...', Array)
#7 C:\xampp\htdocs\ossn\libraries\ossn.lib.plugins.php(75): ossn
view('C:/xampp/htdocs...', Array)
#8 C:\xampp\htdocs\ossn\libraries\ossn.lib.admin.php(265): ossnpluginview('pages/administr...')
#9 C:\xampp\htdocs\ossn\libraries\ossn.lib.page.php(79): ossnadministratorpagehandler(Array, 'administrator')
#10 C:\xampp\htdocs\ossn\index.php(22): ossnloadpage('administrator', Array)
#11 {main}

German Michael Zülsdorff Replied 5 months ago

Please provide those error messages.