Skip to content
This repository has been archived by the owner on Aug 13, 2022. It is now read-only.

Editing Content types error in Windows XAMPP environment #135

Closed
damon18 opened this issue Sep 24, 2013 · 12 comments
Closed

Editing Content types error in Windows XAMPP environment #135

damon18 opened this issue Sep 24, 2013 · 12 comments
Labels
Milestone

Comments

@damon18
Copy link

damon18 commented Sep 24, 2013

Trying to use Content 4.0.1 from
http://community.zikula.org/index.php?module=Wiki&tag=TryZikula13

To upgrade a Zikula 1.2.9 site that used the Pages module for most content in a local Windows 7/XAMPP 1.8.2 environment.

Content installs, configures, creates new pages, and adds content types correctly, but when I click on the content type to edit it there are errors.

For instance trying to edit a html text produces

WARN (4): E_WARNING: mkdir(): Invalid argument in View.php line 835
WARN (4): E_USER_WARNING: Smarty error: problem creating directory 'C:/xampp/htdocs/MaxwellDriving/ztemp/view_compiled/Content/file:C:' in Smarty.class.php line 1093
WARN (4): E_WARNING: include(ztemp/view_compiled/Content/file:C:/xampp/htdocs/MaxwellDriving/modules/Content/templates/contenttype/html_edit--t_Andreas08-l_en.php): failed to open stream: Invalid argument in Smarty.class.php line 1869
WARN (4): E_WARNING: include(): Failed opening 'ztemp/view_compiled/Content/file:C:/xampp/htdocs/MaxwellDriving/modules/Content/templates/contenttype/html_edit--t_Andreas08-l_en.php' for inclusion (include_path='.;C:\xampp\php\PEAR;C:\xampp\htdocs\MaxwellDriving\lib\vendor;C:\xampp\htdocs\MaxwellDriving\system\SecurityCenter\lib\vendor') in Smarty.class.php line 1869

in the spot where the editor should be.

This problem has come up before but I don't see a solution.

Core bug #627 zikula/core#627

Discussed on the German forum http://support.zikula.de/module-CMS_Support_Forum-viewtopic-topic-31225-lang-en.htm

I hope this can be fixed, I've finally been able to update a 1.2.x site to 1.3.5 (release) and now the main module I want to use for the site won't work.

@espaan
Copy link
Member

espaan commented Sep 24, 2013

Hi, on which kind of server are you trying. Content needs a unix/linux server to work, since templates are being searched for in various locations.
It seems to be something related indeed to template stuff. Since people have working Content versions on a lot of servers and Zikula 1.3.x

@damon18
Copy link
Author

damon18 commented Sep 24, 2013

@espaan like the title says, XAMPP (version 1.8.2 which has Apache 2.4.4, MySQL 5.5.32, PHP 5.4.19) on Windows 7.

This is a very common development environment and works on everything else I've thrown at it. Why would Content be different?

@mazdev
Copy link

mazdev commented Sep 25, 2013

The problem is actually Windows7 and Zikula 1.3.5. With Windows7 & Zikula 1.3.4 this problems don't exist.

For the time being to overcome this problem I installed on my local machine Zikula 1.3.4 while on the Main server I use 1.3.5.

@damon18
Copy link
Author

damon18 commented Sep 25, 2013

@mazdev That's interesting, I'll try it. Where did you get 1.3.4? Does the one on the CI install?

http://ci.zikula.org/

@espaan
Copy link
Member

espaan commented Sep 25, 2013

Hi, Content is special in that way that it can get templates from all over the place for the plugins. Other modules can supply plugins and the associated templates. Those templates are being scanned for in a way that is not compatible with a windows environment, sadly. There has been some discussion at that time and since servers are usually linux environments is was left as is.

See https://github.com/zikula-modules/Content/blob/master/lib/Content/AbstractContentType.php#L344

xampp is indeed a standard test environment, but Content is a bit special there :-(

@mazdev
Copy link

mazdev commented Sep 25, 2013

I've got the 1.3.4 from the German Zikula website

@damon18
Copy link
Author

damon18 commented Sep 27, 2013

@mazdev @espaan

I installed Zikula 1.3.4 (build 1494) from http://ci.zikula.org/job/Zikula_Standard-1.3.4-1/lastBuild then installed Content 4.0.1 and just like @mazdev said it works without the errors I got in 1.3.5

So it seems to not be a windows problem but something that was changed in the core between 1.3.4 and 1.3.5

@espaan
Copy link
Member

espaan commented Sep 28, 2013

Hi good to know ! Then there should be something that can be done.

I hope I can check it next week

@espaan
Copy link
Member

espaan commented Jan 23, 2014

Hi, I just did a check in Zikula Core 1.3.4 and also there the current github version of Content and News give the error on Win Xampp, see zikula/core#627
So I'm not sure where the difference comes from that it should work in 1.3.4. The lib/Zikula/View.php files are also exactly the same for 1.3.4 build 35 and 1.3.6. And that is the class that overides smarty functions for obtaining templates.

Maybe you also changed xampp or PHP version ?

@espaan espaan modified the milestones: 4.2.0, 4.1.0 May 14, 2014
@espaan
Copy link
Member

espaan commented May 14, 2014

This will not go in the 4.1 release, which is aimed to be consistent with Scribite 5.
It will need deeper look to get rid of the file; template referencing like it is now.

@espaan
Copy link
Member

espaan commented May 14, 2014

On zikula core 1.3.4 build 12 it does work and changes in DataUtil formatForOS seem to be the change here. See also zikula/core#627 for more comments.

I now notice that going back to DataUtil of Zikula Core 1.3.4 build12 does work with on Windows systems. Apparantly the creating of the compiled version of the template uses FormatForOS, since that is the only difference I could find between 134 and 138 in this problem scope..

What does make it work is changing in DataUtil line 413:

            $dirty_array = preg_split('#[/\\\\]#', $var, -1, PREG_SPLIT_NO_EMPTY);

into

            $dirty_array = preg_split('#[:/\\\\]#', $var, -1, PREG_SPLIT_NO_EMPTY);

not sure why the : was excluded from the pregsplit.

The update was done here:
zikula/core@9e74470

espaan added a commit to espaan/core that referenced this issue May 15, 2014
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | -
| Fixed tickets | zikula#627
| Refs tickets  | zikula-modules/Content#135
| License       | MIT
| Doc PR        | -

On windows test environments an absolute template path is not working currently. Compiled template gives errors, see ticket zikula#627 for more information.
During the change from 1.3.4 build 12 to 1.3.5 this part was changed in zikula@9e74470 

Removal of the : in the preg_split makes that win test environments don't work with absolute template paths any more. I cannot see a side effect of adding this : back in the preg_split.
It does solve windows testing for a number of modules.

ping @cmfcmf can you check as well ?
espaan added a commit to espaan/core that referenced this issue May 15, 2014
| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | -
| Fixed tickets | zikula#627
| Refs tickets  | zikula-modules/Content#135
| License       | MIT
| Doc PR        | -

On windows test environments an absolute template path is not working currently. Compiled template gives errors, see ticket zikula#627 for more information.
During the change from 1.3.4 build 12 to 1.3.5 this part was changed in zikula@9e74470.
This update reverts a part of that udpate.

Removal of the : in the preg_split makes that win test environments don't work with absolute template paths any more. I cannot see a side effect of adding this : back in the preg_split.
It does solve windows testing for a number of modules.

ping @cmfcmf can you check as well ?
@espaan
Copy link
Member

espaan commented May 19, 2014

This ticket can be closed. With some investigation and nice work of cmfcmf there is a patch for 1.3 and 1.4.

@espaan espaan closed this as completed May 19, 2014
@espaan espaan modified the milestones: 4.1.0, 4.2.0 May 19, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants