problem with one in-line action

Archive of support for the automated MOD installation tool codenamed "Blinky". For support questions regarding AutoMOD please visit here.
Suggested Hosts
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTICE: IF YOU NEED SUPPORT FOR AUTOMOD PLEASE VISIT THE APPROPRIATE LOCATION HERE.
User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: problem with one in-line action

Post by Martin Truckenbrodt » Tue Feb 26, 2013 8:19 pm

Hello friends,
@fs65tool: Thank you very much for feedback. BTW: AutoMOD 1.0.2 is the newest AutoMOD release.

@Robert: I will test it next.

@Rich: Yes, this would be a good workaround. Now I can remember that I have seen it on another MOD several time ago. I will test it next days.

I see two reasons for the problem:
1. AutoMOD bug
2. non-valid MODX instructions in my XML file

Bye Martin
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: problem with one in-line action

Post by RMcGirr83 » Tue Feb 26, 2013 9:18 pm

You could also do a double find if I recall correctly
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: problem with one in-line action

Post by Martin Truckenbrodt » Fri Mar 01, 2013 1:17 pm

Hello friends,
some doing some more tests I still have no working result.
I've tested Richs idea. Also I've tested before-add and replace-with insteat of after-add.

Now I see two possible problems:
1. It's a AutoMOD bug.
2. It's problem in ./includes/auth/auth_apache.php

Here's the reported AutoMOD bug: https://www.phpbb.com/bugs/modteamtools ... t_id=63373

Bye Martin
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: problem with one in-line action

Post by Lumpy Burgertushie » Fri Mar 01, 2013 3:01 pm

as I mentioned above, you can't have a inline find when it is not inline.

have you tried this:

find:

Code: Select all

function login_apache(&$username, &$password)
{
	global $db;
find:

Code: Select all

global $db;
after, add:

Code: Select all

global $config;
that would be the proper way to make it work.


robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: problem with one in-line action

Post by Martin Truckenbrodt » Fri Mar 01, 2013 3:12 pm

Hello Robert,
I've tried nearly the same code (only one FIND) and got a not found error error for the FIND. To test it you have to create a XML file and to to test it with AutoMOD.

Somewhere outside of my code there is a bug.

Bye Martin
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: problem with one in-line action

Post by RMcGirr83 » Fri Mar 01, 2013 3:24 pm

Code: Select all

		<open src="includes/auth/auth_apache.php">
			<edit>
				<find><![CDATA[function login_apache(&$username, &$password)]]></find>
			</edit>
			<edit>
				<find><![CDATA[global $db;]]></find>
			</edit>
			<edit>
				<inline-edit>
					<inline-find><![CDATA[$db]]></inline-find>
				</inline-edit>
			</edit>
			<edit>
				<inline-edit>
					<inline-action type="after-add"><![CDATA[, $config]]></inline-action>
				</inline-edit>
			</edit>
		</open>
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: problem with one in-line action

Post by Martin Truckenbrodt » Fri Mar 01, 2013 3:41 pm

Hello Rich,
your code is a well working workaround for this edit. But now the next edit is not running. Here's the whole code for this file:

Code: Select all

		<open src="includes/auth/auth_apache.php">
			<edit>
				<find><![CDATA[		$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type]]></find>
				<inline-edit>
					<inline-find><![CDATA[user_type]]></inline-find>
					<inline-action type="after-add"><![CDATA[, user_email_verified]]></inline-action>
				</inline-edit>
			</edit>
			<edit>
				<find><![CDATA[function login_apache(&$username, &$password)]]></find>
				<find><![CDATA[	global $db;]]></find>
				<inline-edit>
					<inline-find><![CDATA[$db]]></inline-find>
					<inline-action type="after-add"><![CDATA[, $config]]></inline-action>
				</inline-edit>
			</edit>
			<edit>
				<find><![CDATA[					'error_msg'		=> 'ACTIVE_ERROR',]]></find>
				<action type="replace-with"><![CDATA[					'error_msg'		=> (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && !$row['user_email_verified'])) ? 'ACTIVE_ERROR_USER' : (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && $row['user_email_verified'])) ? 'ACTIVE_ERROR_ADMIN' : 'ACTIVE_ERROR')) . ((array_key_exists('contact_version', $config) && $config['contact_version']) ? '_FULL' : ''),]]></action>
			</edit>
		</open>
Bye Martin
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!

User avatar
RMcGirr83
Recognised Extension Developer
Posts: 21034
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr
Contact:

Re: problem with one in-line action

Post by RMcGirr83 » Fri Mar 01, 2013 3:52 pm

Your edits are out of order.

Code: Select all

      <open src="includes/auth/auth_apache.php">
         <edit>
            <find><![CDATA[function login_apache(&$username, &$password)]]></find>
            <find><![CDATA[   global $db;]]></find>
            <inline-edit>
               <inline-find><![CDATA[$db]]></inline-find>
               <inline-action type="after-add"><![CDATA[, $config]]></inline-action>
            </inline-edit>
         </edit>	  
         <edit>
            <find><![CDATA[      $sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type]]></find>
            <inline-edit>
               <inline-find><![CDATA[user_type]]></inline-find>
               <inline-action type="after-add"><![CDATA[, user_email_verified]]></inline-action>
            </inline-edit>
         </edit>
         <edit>
            <find><![CDATA[               'error_msg'      => 'ACTIVE_ERROR',]]></find>
            <action type="replace-with"><![CDATA[               'error_msg'      => (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && !$row['user_email_verified'])) ? 'ACTIVE_ERROR_USER' : (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && $row['user_email_verified'])) ? 'ACTIVE_ERROR_ADMIN' : 'ACTIVE_ERROR')) . ((array_key_exists('contact_version', $config) && $config['contact_version']) ? '_FULL' : ''),]]></action>
         </edit>
      </open>
I am a bit surprised as this is modding 101.
In times of change, learners inherit the earth, while the learned find themselves beautifully equipped to deal with a world that no longer exists - Eric Hoffer
Former Modifications/Extensions Team Member | My extensions
Appreciate the extensions/mods/support then buy me a beer
All requests for support via PM will be ignored

User avatar
Lumpy Burgertushie
Registered User
Posts: 66268
Joined: Mon May 02, 2005 3:11 am
Contact:

Re: problem with one in-line action

Post by Lumpy Burgertushie » Fri Mar 01, 2013 3:54 pm

ok, I tested this on your MOD. it works.
<edit>
<find><![CDATA[function login_apache(&$username, &$password)
{
global $db;]]></find>
<find><![CDATA[global $db;]]></find>
<action type="after-add"><![CDATA[ global $config;]]></action>
</edit>
once that worked, a new error showed up.

you have the last find for the file out of order.

this should be above the previous one:
<edit>
<find><![CDATA[ 'error_msg' => 'ACTIVE_ERROR',]]></find>
<action type="replace-with"><![CDATA[ 'error_msg' => (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && !$row['user_email_verified'])) ? 'ACTIVE_ERROR_USER' : (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && $row['user_email_verified'])) ? 'ACTIVE_ERROR_ADMIN' : 'ACTIVE_ERROR')) . ((array_key_exists('contact_version', $config) && $config['contact_version']) ? '_FULL' : ''),]]></action>
</edit>
once I made those two changes, the MOD installed perfectly.


robert
I am going to be out of town and off line for a week . see ya when I get back.

Premium phpBB 3.2 Styles by PlanetStyles.net

If a tree falls in the forest and nobody is there, does it make a sound?

User avatar
Martin Truckenbrodt
Registered User
Posts: 3045
Joined: Sun Mar 23, 2003 6:22 pm
Location: Franconia
Name: Martin Truckenbrodt
Contact:

Re: problem with one in-line action

Post by Martin Truckenbrodt » Fri Mar 01, 2013 4:08 pm

Hello friends,
I've done another repackaging this minute. This code is running well (on submitting the MOD to the phpbb.com database):

Code: Select all

		<open src="includes/auth/auth_apache.php">
			<edit>
				<find><![CDATA[function login_apache(&$username, &$password)
{
	global $db;]]></find>
				<inline-edit>
					<inline-find><![CDATA[$db]]></inline-find>
					<inline-action type="after-add"><![CDATA[, $config]]></inline-action>
				</inline-edit>
			</edit>
			<edit>
				<find><![CDATA[		$sql = 'SELECT user_id, username, user_password, user_passchg, user_email, user_type]]></find>
				<inline-edit>
					<inline-find><![CDATA[user_type]]></inline-find>
					<inline-action type="after-add"><![CDATA[, user_email_verified]]></inline-action>
				</inline-edit>
			</edit>
			<edit>
				<find><![CDATA[					'error_msg'		=> 'ACTIVE_ERROR',]]></find>
				<action type="replace-with"><![CDATA[					'error_msg'		=> (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && !$row['user_email_verified'])) ? 'ACTIVE_ERROR_USER' : (($config['require_activation'] == USER_ACTIVATION_SELF || ($config['require_activation'] == USER_ACTIVATION_USER_ADMIN && $row['user_email_verified'])) ? 'ACTIVE_ERROR_ADMIN' : 'ACTIVE_ERROR')) . ((array_key_exists('contact_version', $config) && $config['contact_version']) ? '_FULL' : ''),]]></action>
			</edit>
		</open>
Rich is right! This is modding 101! :oops:

In German(y) we have following proverb: Sometimes you don't see the forest. There are too much of trees!

Thank you very much for all of your help and patience!

Bye Martin
Free tutorial: Installing MODs in phpBB 3.0
Advanced Block MOD - Prevent spam on your phpBB 3.0 board with Stop Forum Spam, BotScout, Akismet, Project Honey Pot and several IP-RBL and Domain-RBL DNS blacklists!
My MODs
Use the official phpBB Ideas to vote missing core features!!!

Locked

Return to “[3.0.x] AutoMOD”