xoops forums

Forum Index


Board index » All Posts (geekwright)




geekwright

Quite a regular
Posted on: 9/12 2:44
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#1

Re: xoopsClone issues

There are not a lot of examples for xoopsClone() that I can find.

Assuming $existingObject is a child of XoopsObject
$newObject $existingObject->xoopsClone();

will create a cloned copy of $existingObject.

It is probably wise to instead use PHP's clone like this:
$newObject = clone $existingObject;


It is possible that an object with custom properties might not produce a proper clone with xoopsClone(), while the PHP clone would clone any custom properties.

The clone, in either case, has all the vars copied, and is set as a new object.

One potential problem is that the XoopsObject has no internal knowledge of it's primary key, so while the object is marked new, it still has any auto-increment PK set. You can work around this issue by doing a $newObject->destroyVars('key-variable-name'); to clean up after a clone.

It probably would have made more sense for a xoopsClone() method to be in the handler rather than the object, but this choice was made a long time ago.


geekwright

Quite a regular
Posted on: 7/29 23:30
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#2

Re: Warning with xoInboxCount

Here is a quick review of the problem Goffy experienced for anyone following along.

This will NOT work and triggers the warning:
<{if xoInboxCount}> ... <{/if}>


This will work:
<{xoInboxCount assign="unreadCount"}> <{if $unreadCount}> ... <{/if}>


The output of xoInboxCount goes straight to the page output. Using the assign parameter assigns the count to variable that can be used with the "if" function.


geekwright

Quite a regular
Posted on: 7/28 17:11
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#3

Re: Warning with xoInboxCount

I've not seen this. Can you email me the nav-menu.tpl template file and the nav-menu.tpl.php compiled version so I can look at what it is doing?


geekwright

Quite a regular
Posted on: 7/19 1:33
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#4

Re: wgGallery 1.10 ready for testing

Quote:

goffy wrote:
...
Quote:
Warning: Parameter 1 to MytsGallery::load() expected to be a reference, value given in file /class/module.textsanitizer.php line 774

this is something which is done by the core - maybe Michael or geekwright have an answer

I pulled the latest wgGallery into a XOOPS 2.5.10 system and cannot find any sign of a MytsGallery class anywhere. There has to be another module involved in this error.

In general, references are one of the areas where the rules have changed in PHP, and XOOPS is adapting to the new PHP versions. It probably is a simple fix -- just need to know what code to look at.


geekwright

Quite a regular
Posted on: 5/8 16:46
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#5

Re: http 500 error can't access site

Since I don't see it mentioned I'll ask, have you checked the database tables for errors?


geekwright

Quite a regular
Posted on: 4/16 16:43
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#6

Re: Setup 2.5.10 server to test modules

Quote:

Yurdal wrote:
...
After the inital setup from the xoops side all went ok but see apache log for improvements
...

The install should not generate these errors if everything is copied correctly. Tried three times in different environments, and the log is always clean.

Looking at the errors, I can't see how you could have completed an install. Are you sure these came from the actual install, and not a false start?


geekwright

Quite a regular
Posted on: 4/12 21:04
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#7

Re: Module permissions

Quote:

luciorota wrote:
Hi fellas!
Do you know if has anyone tried to move the definition of permissions in the 'xoops_version.php' file?...
Interesting. My first thought was driving an automated permissions page, similar to the about page:
$moduleAdmin->displayPermissions();


I would like to hear more about what you were thinking.


geekwright

Quite a regular
Posted on: 2/15 19:52
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#8

Re: Xoops 2.5.8.1 Installing issue

Quote:

Userino wrote:
...
Apache has permission over the Xoops Folder.


Only partially. With SELinux, you'll need to change the context for the web directories, too. Here is an article with some details:

https://www.svnlabs.com/blogs/centos-7 ... p-writeaccess-permission/


geekwright

Quite a regular
Posted on: 2/15 2:50
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#9

Re: Xoops 2.5.8.1 Installing issue

Most likely, the user (or group) the webserver's PHP processes run under can't create a file in and/or write to the the xoops_data directory.

IIRC, in CentOS it is the "apache" user that needs to have the permissions. Under debian based distros it is the www-data user.


geekwright

Quite a regular
Posted on: 12/16 17:54
geekwright
geekwright (Show more)
Quite a regular
Posts: 265
Since: 2010/10/15
#10

Re: Database: How do I set a column value to NULL

Quote:
luciorota wrote:
...
I think it is a Xoops limit...

Sadly, you are correct.

I did a dive into the code when I saw your question, and the XoopsObject family seems to have no direct support for NULLs. Updating a column to NULL presently would require building the update query manually and running it with the database query() method.

Likewise the handling of a NULL value in selects seems to be datatype dependent, more like a side effect.



TopTop
(1) 2 3 4 ... 18 »